Skip to content

Instantly share code, notes, and snippets.

View piusayowale's full-sized avatar

OGUNLEYE AYOWALE piusayowale

  • Lagos, Nigeria
View GitHub Profile
@piusayowale
piusayowale / bstinversion.cpp
Created February 1, 2022 14:16
invert binary search tree
struct Node {
int value;
Node* left;
Node* right;
};
Node* insert(Node* list, int value) {
if (list == nullptr) {
@piusayowale
piusayowale / SDL2Skia.cpp
Created February 10, 2022 18:55
Play with SDL and SKIA
// 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>
@piusayowale
piusayowale / yogaSkia.cpp
Created February 13, 2022 07:11
Yoga with Skia
#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 <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 <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>
#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/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>
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
typedef struct {
int is_free;
uint32_t key;
char value[10];
}bin;
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];
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){