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
# Bubble sort in python | |
__author__ ='Sudhashu Patel' | |
class BubbleSort: | |
def __init__(self, ls=[5,3,6,2,4,7,4,3]): | |
self.ls = ls | |
self.length = len(self.ls) | |
def sort(self, reverse=False): | |
if reverse: |
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> | |
#define SIZE 10 | |
void print(int arr[]); | |
void mergeSort(int arr[],int base,int end); | |
void merge(int arr[],int base,int mid, int end); | |
int main(){ | |
int arr[SIZE]={5,32,7,2,8,7,9,6,43,65}; | |
print(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
7c54feb6bab5404ba3ab660a3fd04e77c1212b055d8e1cbf34a42049aa82c47a9ee0577f3575c1c7a25c235e0982677c2801f2f253372d16f9ae60804a20ffc8 |
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
__author__='Sudhanshu Patel' | |
''' | |
Binary search tree implementation | |
# goes left if key less than node.key else right | |
1. insetion | |
2. Preorder | |
3. postorder | |
4. inorder traversal | |
5. find max depth | |
6. print all leaf 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
/* Sudhanshu Patel sudhanshuptl13@gmail.com */ | |
/* | |
Min Heap implementation in c | |
*/ | |
#include<stdio.h> | |
#include<stdlib.h> | |
/* | |
Array Implementation of MinHeap data Structure | |
*/ |
OlderNewer