Simple C programs to learn Data Structures step by step
Perfect for college students and beginners 🎓
This project has easy-to-understand C programs for learning data structures. Every program has comments to help you learn.
Why use this?
- ✅ Simple and clear code
- ✅ Good for beginners
- ✅ Works on all computers
- ✅ Extra practice files included
| Topic | What You'll Learn |
|---|---|
| Arrays | Store and find data, insert and delete items |
| Linked Lists | Connect data with pointers (single, double, circular) |
| Stacks | Last-in, first-out operations, parenthesis checking |
| Queues | First-in, first-out operations |
| Trees | Binary trees, search trees, tree walking |
| Sorting | Bubble, selection, insertion, quick, merge sort |
| Pointers | How memory works in C |
001 Arrays/ → Basic array programs
002 Linked List/ → All types of linked lists
003 Stack/ → Stack using array and linked list
004 Pointer Revision/ → Understand pointers
005 Queue/ → Queue operations
006 Link List/ → More linked list practice
007 Trees/ → Binary trees and operations
008 Sorting/ → All sorting methods
Each folder has a Revision/ subfolder with extra practice programs.
- GCC Compiler - to run C programs
- Text Editor - VS Code, Code::Blocks, or any editor
- Terminal - to type commands
Windows:
Download from: https://sourceforge.net/projects/mingw/Linux:
sudo apt install gccMac:
xcode-select --installgit clone https://github.com/ggauravky/Data-Structure-using-C.git
cd Data-Structure-using-Ccd "001 Arrays" # Start here if you're new
cd "002 Linked List"
cd "003 Stack"# Compile the program
gcc filename.c -o output
# Run it
./output # On Linux/Mac
output.exe # On WindowsExample:
cd "001 Arrays"
gcc Linear_Search.c -o search
./searchLinear_Search.c- Find an item in a listBinary_search.c- Fast search in sorted listinsertion_array.c- Add items to arraydeletion_array.c- Remove items from array
intro_linked_list.c- Create your first linked listtraverse_create.c- Visit all nodesDoubly Linked Lists.c- Two-way linked listCircular Linked Lists.c- Loop back to start
Implementing Stack using array.c- Stack basicsPush, PopOperationsinStack.c- Add and removeParenthesis Matching Problem.c- Check bracketsCoding Infix to Postfix.c- Convert expressions
simplebinarytree.c- Your first treeBinaryTreeAllTraversals.c- Walk through treeBubbleSort.c- Basic sortingQuickSort.c- Fast sorting
1. Start → 001 Arrays (understand basics)
2. Next → 002 Linked List (learn pointers)
3. Then → 003 Stack (LIFO concept)
4. After → 005 Queue (FIFO concept)
5. Finally → 007 Trees (advanced structure)
Tip: Do one program daily and try changing the code to see what happens!
Want to help? You can:
- Fix bugs or errors
- Add more programs
- Improve comments
- Suggest new topics
Steps:
- Fork this project
- Make your changes
- Send a pull request
If this helped you learn, give it a star ⭐
MIT License - Free to use for learning
© 2024-2025 Gaurav Kumar
Happy Learning! 🚀
Made with ❤️ for students