Skip to content

Instantly share code, notes, and snippets.

View graphoarty's full-sized avatar
🎯
Focusing

Quinston Pimenta graphoarty

🎯
Focusing
  • https://quinston.com
  • Pune, India
View GitHub Profile
public class Stack {
static final int max = 5;
int[] stack = new int[max];
int top;
Stack(){
top = 0;
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++){
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++){
#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;
'''
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
changed
3. Disconnect the last element counting the length from
the new root.
'''
#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;
#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;
#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.
class Node{
int data;
Node right;
Node left;
static int noOfNodes = 0;
Node(int data){
this.data = data;
#include <iostream>
#include <cmath>
using namespace std;
int BinarySearch(int L[], int left, int right, int key){
if(right - left > 0){
int mid = (left + right) / 2;