Skip to content

Instantly share code, notes, and snippets.


Quinston Pimenta graphoarty

Block or report user

Report or block graphoarty

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:3ee6eefda19ce7684ad4dc578e8572a9
public class Main {
/*Static variable which acts as the pointer for the preorder list*/
static int preIndex = 0;
public static void main(String[] args) {
/*Inorder Array*/
char[] inOrder = { 'D', 'B', 'E', 'A', 'F', 'C' };
/*Preorder Array*/
View gist:804517b689775e2f687360a2094a1c57
public class Stack {
static final int max = 5;
int[] stack = new int[max];
int top;
top = 0;
View gist:735da042165b51152070976f391ae495
public class QuickSortTest {
public static final int max = 10;
public static void main(String[] args){
int[] toSortArray = new int[max];
for(int i = 0; i < max; i++){
View gist:71efa919476c2a26395016d7fea3bc58
public class bubbleSort {
private static final int max = 10;
public static void main(String[] args){
int[] array = new int[max];
System.out.println("The array to be sorted is");
for(int i = 0; i < max; i++){
View gist:22fd9a4fe8eb42e8d124cf8c86335a1e
#include <iostream>
#include <cmath>
using namespace std;
int z = 0;
int interpolation(int arr[], int left, int right, int key){
int low = left;
int high = right - 1;
View gist:034f4d79a073da801e33a738e0f8bc05
Rotating the Linked List
1. Convert the Linked List into a Circular Linked List
by joining the last node with the root.
2. Move the root the amount of positions needed to be
3. Disconnect the last element counting the length from
the new root.
View gist:95b40134ff67d786657d32aa158ff980
#include <iostream>
#include <cstring>
using namespace std;
// brute force the entire thing.
char* getSubstring(char c[], int starting, int ending){
int length = ending - starting + 1;
int temp = length;
View gist:d13dd1ffed169a4d822acf26d3e8d7cd
#include <iostream>
using namespace std;
int getPosition(int key, int searchSpace[], int length){
for(int i = 0; i < length; i++){
if(searchSpace[i] == key){
return i;
View gist:755871968de93a6df8bfde1b2c5ca4c5
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// arguments int limit, int windowShift
int getRandomNumber(int limit, int windowShifter){
return ( rand() % limit ) + windowShifter;
// Should be done in parallel.
View gist:bba4bdac141bdc9f4189f7b562fe7916
class Node{
int data;
Node right;
Node left;
static int noOfNodes = 0;
Node(int data){ = data;
You can’t perform that action at this time.