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 / main.cpp
Created November 2, 2020 13:48
Basic Filament with SDL windows
#include <iostream>
#include <filament/Engine.h>
#include <filament/SwapChain.h>
#include <filament/Renderer.h>
#include <filament/Material.h>
#include <filament/MaterialInstance.h>
#include <filament/Camera.h>
#include <filament/Skybox.h>
#include <filament/View.h>
#include <filament/Scene.h>
@piusayowale
piusayowale / selectionsort.cpp
Created January 22, 2022 10:33
C++ implementation of selection sort
#include <iostream>
int findSmallestIndex(int* arr, int index, int len) {
int smallestIdx = index;
int counter = index;
while (counter < len)
{
@piusayowale
piusayowale / linkedlist.cpp
Created January 22, 2022 15:44
Linked list with swap function
struct Node {
int value;
Node* next;
};
Node* insert(Node*& list, int value) {
Node* temp = nullptr;
@piusayowale
piusayowale / linkedlistSelectionSort.cpp
Created January 23, 2022 06:10
Selection sort on linked list
struct Node {
int value;
Node* next;
};
Node* insert(Node*& list, int value) {
Node* temp = nullptr;
Node* ptr = list;
@piusayowale
piusayowale / SelectionSort.cpp
Created January 23, 2022 12:40
Selection Sort
void swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
void selectionSort(int arr[], int len) {
int smallest;
for (int i = 0; i < len; i++) {
@piusayowale
piusayowale / linkedListSelectionSort2.cpp
Created January 24, 2022 08:54
Linked list selection sort 2
void swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
struct Node {
int value;
@piusayowale
piusayowale / Quicksort.cpp
Created January 24, 2022 11:04
Quick sort in cpp
void swap(int* a, int* b) {
int temp = *a;
*a = *b;
*b = temp;
}
int partition(int* arr, int low, int hi) {
int pivot = arr[hi];
@piusayowale
piusayowale / DoublyLinkedlist.cpp
Created January 24, 2022 13:15
doubly linked list
struct Node {
int value;
Node* next;
Node* prev;
};
static Node* head = nullptr;
static Node* tail = nullptr;
@piusayowale
piusayowale / SearchBST.cpp
Created January 28, 2022 07:48
Search and extract node in a BST
struct Node
{
Node* left;
Node* right;
int value;
};
Node* insert(Node* tree, int value) {
if (tree == nullptr) {
Node* temp = new Node;
@piusayowale
piusayowale / skiabitmap.cpp
Created January 30, 2022 17:23
Skia write to bitmap example
#include <iostream>
#include <skia/core/SkCanvas.h>
#include <skia/core/SkBitmap.h>
#include <skia/codec/SkCodec.h>
#include <skia/core/SkPath.h>
#include <skia/core/SkColor.h>
#include <skia/encode/SkPngEncoder.h>
#include <skia/core/SkStream.h>
#include <skia/core/SkImageEncoder.h>
#include <skia/core/SkData.h>