Data Structures and Algorithms
This repository is a comprehensive collection of implementations for various data structures and algorithms, written primarily in C and Java. It serves as a valuable resource for learning and understanding the fundamentals of computer science concepts.
Project Structure
The repository is organized into several directories, each focusing on specific topics:
- 1D-Array, 2D-Arrays: Examples and operations on 1D and 2D arrays implemented in Java.
- Booths-Algorithm: Implementation of Booth's Algorithm for multiplication in C.
- Bubble-Sort-Number-of-Swaps: Bubble Sort algorithm demonstrating the number of swaps, written in C.
- Conditional-LL-Insertion: Conditional linked list insertion operations in C.
- FileIO-LL-Operations: File I/O operations with linked lists in C.
- Hash-Tables: Basic implementation of hash tables in C.
- Heap-Sort: Heap Sort algorithm examples in C.
- Inserting-Node-LL: Techniques for inserting a node into a linked list in C.
- Palindrome-Check-Stacks: Using stacks to check for palindromes in C.
- Recursive-Binary-Search: Implementation of the recursive binary search algorithm in C.
- Sorting-Algorithms: Various sorting algorithms (e.g., Quick Sort, Merge Sort) implemented in C.
- Tries-Num-of-Occurances: Implementation of tries to count the number of occurrences of words in C.
Getting Started
To explore and run the programs:
- Clone the repository to your local machine.
- Navigate to the directory of the topic you're interested in.
- Compile and excecute the
main file, according to each language.
Compiling C Programs
To compile a C program, use the GCC compiler with the following command:
gcc program_name.c -o program_output_name
For example, if you have a file named main.c, you can compile it to an executable named main like this:
gcc main.c -o main
Then, run the program with:
./main
Compiling Java Programs
To compile a Java program, use the javac compiler:
javac ClassName.java
For example, if your Java class is in a file named Main.java, you would compile it like this:
javac Main.java
This generates a Main.class file that you can run with the java command:
java Main
Make sure your java command is run from the same directory where your .class file is located, or specify the classpath to where the file resides.