This repository contains implementations of fundamental Data Structures and Algorithms (DSA) in the C programming language.
It is designed as a reference and practice resource for students, beginners, and anyone preparing for coding interviews.
DSA-Algorithms-main/
├── basics/
│ ├── array_search.c
│ ├── fibonacci_recursive_series.c
│ ├── fibonacci_swapping.c
│ ├── linked_list.c
│ ├── queue_using_array.c
│ ├── queue_using_linkedlist.c
│ ├── stack_using_array.c
│ └── stack_using_linkedlist.c
│
├── searching_algorithms/
│ ├── Binary_Search.c
│ ├── Linear_Search_sorted.c
│ └── Linear_Search_unsorted.c
│
├── sorting_algorithms/
│ ├── bubble_sort.c
│ ├── insertion_sort.c
│ └── merge_sort.c
│
└── README.md
Note:
.exe
files are compiled outputs and can be ignored.
To run the programs, you need a C compiler such as gcc
.
On Linux/macOS, you can install GCC using:
sudo apt-get install build-essential # Ubuntu/Debian
brew install gcc # macOS (Homebrew)
On Windows, you can use MinGW or an IDE like Code::Blocks or Dev-C++.
To compile and run a C program:
gcc filename.c -o program
./program
Example:
gcc basics/linked_list.c -o linked_list
./linked_list
- Basics: Arrays, Fibonacci series, Linked List, Stack, Queue
- Searching Algorithms: Linear Search (sorted & unsorted), Binary Search
- Sorting Algorithms: Bubble Sort, Insertion Sort, Merge Sort
- Clear and simple C implementations
Compile and run a sorting algorithm:
gcc sorting_algorithms/merge_sort.c -o merge_sort
./merge_sort
Run a searching algorithm:
gcc searching_algorithms/Binary_Search.c -o binary_search
./binary_search
Contributions are welcome!
Feel free to open issues or submit pull requests with improvements, bug fixes, or new algorithm implementations.
This project is licensed under the MIT License.
You are free to use, modify, and distribute this project with attribution.