Here are some examples of Algorithm written in ANSI C.
Even do they are written in ANSI C, I would advice to compile them in Linux as I did. If you encounter any problems or errors, please let me know by providing an example of the code, input, output, and an explanation. Thanks.
NOTIFICATION: These examples are provided for educational purposes. Using this code is under your own responsibility and risk. I do not take responsibilities of how they are used.
- Bubble sort. Code
Example code: carlstein_p01.c – Test File: carlstein_p01_integers.txt - Heap sort
Example code: carlstein_p02.c – Test File: carlstein_p02_integers_1.txt - Binary Search using Heapsort
Example code: carlstein_p03.c – Test Files: carlstein_p03_integers _1.txt, carlstein_p03_integers_2.txt - Quicksort using Hoarse partition and random partition
Example code: carlstein_p04.c – Test Files: carlstein_p04_integers_1.txt, carlstein_p04_integers_2.txt - Knapsack
Example code: carlstein_p05.c – Test Files: carlstein_p05_integer_1.txt, carlstein_p05_integer_2.txt, carlstein_p05_integers_3.txt - Ferry Loading
Example code: carlstein_p06.c – Test Files: carlstein_p06_input_1.txt, carlstein_p06_input_2.txt, carlstein_p06_input_3.txt, carlstein_p06_input_4.txt - Huffman algorithm using heap
Example code: carlstein_p07.c – Test Files: carlstein_p07_input_1.txt, carlstein_p07_input_2.txt, carlstein_p07_input_3.txt, carlstein_p07_input_4.txt - Kurskay’s algorithm using Disjoint Sets and heap
Example code: carlstein_p08.c – Test Files: carlstein_p08_input_1.txt, carlstein_p08_input_2.txt, carlstein_p08_input_3.txt, carlstein_p08_input_4.txt - Disjktra algorithm using heap
Example code: carlstein_p09.c – Test Files: carlstein_p09_input_1.txt, carlstein_p09_input_2.txt, carlstein_p09_input_3.txt, carlstein_p09_input_4.txt - Vertex Cover algorithm using heap
Example code: carlstein_p10.c – Test Files: carlstein_p10_input_1.txt, carlstein_p10_input_2.txt, carlstein_p10_input_3.txt, carlstein_p10_input_4.txt, carlstein_p10_input_5.txt, carlstein_p10_input_6.txt, carlstein_p10_input_7.txt
© 2010, Alejandro G. Carlstein Ramos Mejia. All rights reserved.