diff --git a/Computer Oriented Statistical Methods/simpson's 1-3rd rule.c b/Computer Oriented Statistical Methods/Simpson's_1-3rd_rule.c similarity index 100% rename from Computer Oriented Statistical Methods/simpson's 1-3rd rule.c rename to Computer Oriented Statistical Methods/Simpson's_1-3rd_rule.c diff --git a/conversions/decimal2Binary.c b/Conversions/decimal _to_binary.c similarity index 100% rename from conversions/decimal2Binary.c rename to Conversions/decimal _to_binary.c diff --git a/conversions/decimal2Hexa.c b/Conversions/decimal_to_hexa.c similarity index 100% rename from conversions/decimal2Hexa.c rename to Conversions/decimal_to_hexa.c diff --git a/conversions/decimal2Octal.c b/Conversions/decimal_to_octal.c similarity index 100% rename from conversions/decimal2Octal.c rename to Conversions/decimal_to_octal.c diff --git a/data_structures/binary_trees/create_node.c b/Data Structures/binary_trees/create_node.c similarity index 100% rename from data_structures/binary_trees/create_node.c rename to Data Structures/binary_trees/create_node.c diff --git a/data_structures/binary_trees/recursiveTraversals.c b/Data Structures/binary_trees/recursive_traversals.c similarity index 100% rename from data_structures/binary_trees/recursiveTraversals.c rename to Data Structures/binary_trees/recursive_traversals.c diff --git a/data_structures/linked_list/singly_link_list_deletion.c b/Data Structures/linked_list/singly_link_list_deletion.c similarity index 100% rename from data_structures/linked_list/singly_link_list_deletion.c rename to Data Structures/linked_list/singly_link_list_deletion.c diff --git a/data_structures/queue.c b/Data Structures/queue.c similarity index 100% rename from data_structures/queue.c rename to Data Structures/queue.c diff --git a/data_structures/stack.c b/Data Structures/stack.c similarity index 100% rename from data_structures/stack.c rename to Data Structures/stack.c diff --git a/data_structures/Trie/dictionary.txt b/Data Structures/trie/dictionary.txt similarity index 100% rename from data_structures/Trie/dictionary.txt rename to Data Structures/trie/dictionary.txt diff --git a/data_structures/Trie/Trie.c b/Data Structures/trie/trie.c similarity index 100% rename from data_structures/Trie/Trie.c rename to Data Structures/trie/trie.c diff --git a/README.md b/README.md index 280aa3e6..1c25b07e 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,60 @@ # C All Algorithms implemented in C + +# Computer Oriented Statistical Methods + - Gauss_Elimination + - Lagrange_Theorem + - Mean + - Median + - Seidal + - Simpson's_1-3rd_rule.c + - Variance + + +# Conversions + - binary_to_decimal + - decimal _to_binary + - decimal_to_hexa + - decimal_to_octal + + +# Data Structures + - stack + - queue + ## linked_list + - singly_link_list_deletion + ## binary_trees + - create_node + - recursive_traversals + ## trie + - trie + + +# Searching + - Binary_Search + - Other_Binary_Search + + +# Sorting + - binary_insertion_sort + - BubbleSort + - BogoSort + - InsertionSort + - mergesort + - OtherBubbleSort + - QuickSort + - SelectionSort + - shaker_sort + + +# Misc + - Binning + - Factorial + - Fibonacci + - isArmstrong + - LongestSubSequence + - palindrome + - QUARTILE + - rselect + - strongNumber + - TowerOfHanoi diff --git a/searching/BinarySearch.c b/Searching/Binary_Search.c similarity index 100% rename from searching/BinarySearch.c rename to Searching/Binary_Search.c diff --git a/searching/otherBinarySearch.c b/Searching/Other_Binary_Search.c similarity index 100% rename from searching/otherBinarySearch.c rename to Searching/Other_Binary_Search.c diff --git a/sorting/mergesort.c.c b/Sorting/mergesort.c similarity index 93% rename from sorting/mergesort.c.c rename to Sorting/mergesort.c index dd14713a..bbe0ffe8 100644 --- a/sorting/mergesort.c.c +++ b/Sorting/mergesort.c @@ -1,91 +1,91 @@ -#include - -void swap (int *a,int *b) -{ - int t; - t= *a; - *a=*b; - *b=t; - -} - -void merge(int a[],int l,int r,int n) -{ int *b = (int*)malloc(n*sizeof(int)); -int c=l; - int p1,p2; - p1 = l;p2=((l+r)/2)+1; - while ((p1<((l+r)/2)+1) &&(p2a[r]) - swap(&a[l],&a[r]); - - } - else if(l==r) - {} - else - {mergesort(a,n,l,(l+r)/2); - mergesort(a,n,((l+r)/2)+1,r); - merge(a,l,r,n); - - } - -} -int main(void) { -int *a,n,i; -scanf("%d",&n); -a = (int*)malloc(n*sizeof(int)); -for (i=0;i + +void swap (int *a,int *b) +{ + int t; + t= *a; + *a=*b; + *b=t; + +} + +void merge(int a[],int l,int r,int n) +{ int *b = (int*)malloc(n*sizeof(int)); +int c=l; + int p1,p2; + p1 = l;p2=((l+r)/2)+1; + while ((p1<((l+r)/2)+1) &&(p2a[r]) + swap(&a[l],&a[r]); + + } + else if(l==r) + {} + else + {mergesort(a,n,l,(l+r)/2); + mergesort(a,n,((l+r)/2)+1,r); + merge(a,l,r,n); + + } + +} +int main(void) { +int *a,n,i; +scanf("%d",&n); +a = (int*)malloc(n*sizeof(int)); +for (i=0;i