Skip to content

A comprehensive collection of Data Structures implemented in C. Explores low-level concepts including Pointers, Memory Allocation, Linked Lists, Stacks, Queues, and Trees.

License

Notifications You must be signed in to change notification settings

ggauravky/Data-Structure-using-C

Repository files navigation

C Logo

Data Structures in C

C License Stars

Simple C programs to learn Data Structures step by step

Perfect for college students and beginners 🎓

Get StartedTopicsHow to Use


📖 About

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

📚 Topics Covered

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

📂 What's Inside

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.


🚀 Getting Started

What You Need

  • GCC Compiler - to run C programs
  • Text Editor - VS Code, Code::Blocks, or any editor
  • Terminal - to type commands

Install GCC

Windows:

Download from: https://sourceforge.net/projects/mingw/

Linux:

sudo apt install gcc

Mac:

xcode-select --install

💻 How to Use

1. Download This Project

git clone https://github.com/ggauravky/Data-Structure-using-C.git
cd Data-Structure-using-C

2. Choose a Topic

cd "001 Arrays"      # Start here if you're new
cd "002 Linked List"
cd "003 Stack"

3. Run Any Program

# Compile the program
gcc filename.c -o output

# Run it
./output              # On Linux/Mac
output.exe            # On Windows

Example:

cd "001 Arrays"
gcc Linear_Search.c -o search
./search

📝 Program Examples

Arrays

  • Linear_Search.c - Find an item in a list
  • Binary_search.c - Fast search in sorted list
  • insertion_array.c - Add items to array
  • deletion_array.c - Remove items from array

Linked Lists

  • intro_linked_list.c - Create your first linked list
  • traverse_create.c - Visit all nodes
  • Doubly Linked Lists.c - Two-way linked list
  • Circular Linked Lists.c - Loop back to start

Stacks

  • Implementing Stack using array.c - Stack basics
  • Push, PopOperationsinStack.c - Add and remove
  • Parenthesis Matching Problem.c - Check brackets
  • Coding Infix to Postfix.c - Convert expressions

Trees & Sorting

  • simplebinarytree.c - Your first tree
  • BinaryTreeAllTraversals.c - Walk through tree
  • BubbleSort.c - Basic sorting
  • QuickSort.c - Fast sorting

🎯 Learning Path

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!


🤝 Contribute

Want to help? You can:

  • Fix bugs or errors
  • Add more programs
  • Improve comments
  • Suggest new topics

Steps:

  1. Fork this project
  2. Make your changes
  3. Send a pull request

📬 Connect

LinkedIn GitHub Instagram

Questions? Feel free to ask! 💬


⭐ Support

If this helped you learn, give it a star ⭐


📄 License

MIT License - Free to use for learning

© 2024-2025 Gaurav Kumar


Happy Learning! 🚀

Made with ❤️ for students

About

A comprehensive collection of Data Structures implemented in C. Explores low-level concepts including Pointers, Memory Allocation, Linked Lists, Stacks, Queues, and Trees.

Topics

Resources

License

Stars

Watchers

Forks

Languages