This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Node { | |
int value; | |
Node* left; | |
Node* right; | |
}; | |
Node* insert(Node* list, int value) { | |
if (list == nullptr) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// testSkia.cpp : This file contains the 'main' function. Program execution begins and ends there. | |
// | |
#include <skia/gpu/GrContext.h> | |
#include <SDL2/SDL.h> | |
#include <skia/core/SkCanvas.h> | |
#include <skia/utils/SkRandom.h> | |
#include <skia/core/SkSurface.h> | |
#include <skia/gpu/gl/GrGLInterface.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <algorithm> | |
#include <yoga/Yoga.h> | |
#include <yoga/YGNode.h> | |
#include <yoga/YGLayout.h> | |
#include <yoga/YGStyle.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <algorithm> | |
#include <yoga/Yoga.h> | |
#include <yoga/YGNode.h> | |
#include <yoga/YGLayout.h> | |
#include <yoga/YGStyle.h> | |
#include <skia/core/SkCanvas.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <algorithm> | |
#include <yoga/Yoga.h> | |
#include <yoga/YGNode.h> | |
#include <yoga/YGLayout.h> | |
#include <yoga/YGStyle.h> | |
#include <skia/core/SkCanvas.h> | |
#include <skia/core/SkColor.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <map> | |
#include <string> | |
#include <algorithm> | |
#include <yoga/Yoga.h> | |
#include <yoga/YGNode.h> | |
#include <yoga/YGLayout.h> | |
#include <yoga/YGStyle.h> | |
#include <skia/core/SkCanvas.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <skia/gpu/GrContext.h> | |
#include <SDL2/SDL.h> | |
#include <skia/core/SkCanvas.h> | |
#include <skia/utils/SkRandom.h> | |
#include <skia/core/SkSurface.h> | |
#include <skia/gpu/gl/GrGLInterface.h> | |
#include <skia/core/SkFont.h> | |
#include <skia/core/SkColor.h> | |
#include <skia/core/SkMatrix.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct { | |
int is_free; | |
uint32_t key; | |
char value[10]; | |
}bin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vector<int> rotLeft(vector<int> a, int d) { | |
vector<int> temp(a.size()); | |
int i = 0; | |
for(i = 0; d+i < a.size(); i++){ | |
temp[i] = a[d+i]; | |
std::cout << temp[i]; | |
} | |
int t = 0; | |
while(i < a.size()){ | |
temp[i] = a[t]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void minimumBribes(vector<int> q) { | |
bool chaotic = false; | |
int bribes = 0; | |
for (int i = 0; i < q.size(); i++) { | |
if (q[i] - (i+1) > 2) { chaotic = true; } | |
for (int j = q[i] - 2; j < i; j++) { | |
if (q[j] > q[i]) { bribes++; } | |
} | |
} | |
if(chaotic == true){ |