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
import random
matrix = [[0 for x in xrange(5)] for x in xrange(5)]
visited = [[0 for x in xrange(5)] for x in xrange(5)]
def printMatrix(toPrint):
for x in range (0, 5):
for y in range (0, 5):
print toPrint[x][y],
print
def RecursiveLoop(a, b):
coorD = 0;
def cartesianProduct(setA, setB):
if len(setA) == 0:
return None
if len(setB) == 0:
return None
product = []
for elementA in setA:
def main():
count = int(raw_input("How many numbers do you want to print?"))
if count == 0:
print "No Numbers Printed"
else:
a = 0
b = 1
print a,
if count > 1:
print b,
public class Main {
/* Static variable which acts as the pointer for the postOrder list */
static int preIndex = 5;
public static void main(String[] args) {
/* InOrder Array */
char[] inOrder = { 'D', 'B', 'E', 'A', 'F', 'C' };
/* PostOrder Array */
public class SelectionSort {
public static final int max = 10;
public static void main(String[] args){
int[] toSortArray = new int[max];
int min=999;
int minIndex = 0;
public class Queue {
//initialize
//enqueue
//dequeue
//empty
//print
//adjustQueue
static final int max = 10;
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++){
import random
#the sort function
def sort(array):
#the length of the array
length = len(array)
#for loop which ranges from
#1 to the length of the array
#this loop is to cover each and
#every number and ensure its
/*Import house keeping stuff that we need to connect with the Database*/
import java.sql.*;
/*Import Scanner Class so as to take input from the user*/
import java.util.Scanner;
public class Main {
static Connection connection;
static Scanner scan;
static Statement statement;
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*/