This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct node { | |
int data; | |
node *left, *right; | |
}node; | |
//prototypes of functions | |
int height (node *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
struct node { | |
struct node *left; | |
int data ; | |
struct node *right; | |
}; | |
struct node *root = NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
typedef struct node { | |
int data; | |
node *left, *right; | |
}node; | |
//prototypes of functions | |
int height (node *); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//compiled with compileonline.com | |
//http://www.compileonline.com/compile_objective-c_online.php | |
//also compiled using GNUSetup on windows. | |
#import <Foundation/Foundation.h> | |
@interface Book : NSObject | |
{ | |
char * title; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/env/path python | |
items = [2,5,6,7,8,5,0,1,2,3,4] | |
def quick_sort(items): | |
""" Implementation of quick sort """ | |
if len(items) > 1: | |
pivot_index = len(items) // 2 | |
smaller_items = [] | |
larger_items = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
items = [2,5,6,7,8,5,0,1,9,3,4] | |
#items = [3, 4, 5, 2 ,1] | |
def quick_sort(items,first,last): | |
""" Implementation of in-place quicksort """ | |
if(first < last): | |
pivot, left, right = first, first, last | |
while(left<right): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void quicksort(int [10],int,int); | |
int main(){ | |
int x[20],size,i; | |
printf("Enter size of the array: "); | |
scanf("%d",&size); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/env/path python | |
arr = [6,5,4,7,8,4,3,2,1,45,23,67,34] | |
def bubble_sort(arr): | |
swapped, j = True, 1 | |
length = len(arr) | |
while(swapped): | |
swapped = False | |
for i in range(0,length-j): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
import java.util.*; | |
public class MergeSortAlgo{ | |
static int arr[] = { 11,34,55,67,23,64,78,34,12,84,33,5,5}; | |
private void MergeSort(int [] arr) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdbool.h> | |
void bubblesort(int *arr, int size) | |
{ | |
int i = 0, temp; | |
int j = 1; | |
OlderNewer