Skip to content

NIRMAL1090/Data-Structure

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

🗂️ Data Structures Implementation in C

This repository includes comprehensive implementations of fundamental data structures using the C programming language.
All code is written and implemented by me with simplicity and clarity in mind.

📖 Description

This repository serves as a complete reference for essential data structures in computer science, implemented in C programming language. It covers three fundamental categories of data structures: Linked Lists, Stacks, and Queues. Each implementation is designed with educational purposes in mind, featuring clean, well-commented code that demonstrates core concepts and operations.

🎯 Purpose & Goals

The repository is perfect for:

  • Students learning data structures and algorithms
  • Developers looking for reference implementations
  • Educators seeking teaching materials
  • Interview preparation for programming roles
  • Academic projects requiring data structure implementations

🔍 What Makes This Repository Special

  • Complete Coverage: Implements multiple variations of each data structure
  • Educational Focus: Code is written with clarity and learning in mind
  • Real-world Applications: Each implementation includes practical examples
  • Multiple Approaches: Shows both array-based and linked list-based implementations
  • Beginner Friendly: Well-commented code with clear function names
  • Comprehensive Operations: Each structure includes all essential operations

📁 Data Structures Included

🔗 Linked Lists

  1. Singly Linked List - Basic linear linked structure
  2. Singly Circular Linked List - Circular variation of singly linked list
  3. Doubly Linked List - Bidirectional linked structure
  4. Doubly Circular Linked List - Circular variation of doubly linked list

📚 Stacks (LIFO - Last In First Out)

  1. Stack using Array - Array-based implementation
  2. Stack using Linked List - Dynamic memory implementation
  3. Stack using Doubly Linked List - Enhanced linked list approach

🚶 Queues (FIFO - First In First Out)

  1. Queue using Array - Static array implementation
  2. Queue using Linked List - Dynamic implementation
  3. Circular Queue - Efficient circular buffer implementation

⚙️ Common Operations

Each data structure includes relevant functions such as:

Linked Lists Operations:

  • Insert at beginning
  • Insert at end
  • Insert at specific position
  • Delete from beginning
  • Delete from end
  • Delete from specific position
  • Search a node
  • Display list
  • Count nodes
  • Reverse the list

Stack Operations:

  • Push (insert element)
  • Pop (remove top element)
  • Peek/Top (view top element)
  • isEmpty (check if stack is empty)
  • isFull (check if stack is full - for array implementation)
  • Display stack
  • Count elements

Queue Operations:

  • Enqueue (insert element)
  • Dequeue (remove front element)
  • Front (view front element)
  • Rear (view rear element)
  • isEmpty (check if queue is empty)
  • isFull (check if queue is full - for array implementation)
  • Display queue
  • Count elements

📂 Folder Structure

LinkedList/
│
├── Linked List/
│   ├── singly_linkedlist.c      → Singly Linked List
│   ├── singly_circular.c        → Singly Circular Linked List
│   ├── doubly_linkedlist.c      → Doubly Linked List
│   └── doubly_circular.c        → Doubly Circular Linked List
│
├── Stack/
│   ├── stack_array.c            → Stack using Array
│   ├── stack_linkedlist.c       → Stack using Linked List
│   └── stack_doubly_linkedlist.c → Stack using Doubly Linked List
│
└── Queue/
    ├── queue_array.c            → Queue using Array
    ├── queue_linkedlist.c       → Queue using Linked List
    └── queue_circular.c         → Circular Queue

🛠️ How to Compile & Run

Use any C compiler like GCC to compile and run the programs:

# For Windows (using GCC)
gcc filename.c -o output.exe
output.exe

# For Linux/Mac
gcc filename.c -o output
./output

Example Usage:

# Navigate to the desired folder
cd "Linked List"

# Compile the singly linked list program
gcc singly_linkedlist.c -o singly_linkedlist.exe

# Run the program
singly_linkedlist.exe

Make sure to navigate to the correct folder containing the .c file before compiling.

🚀 Getting Started

  1. Clone the repository:

    git clone https://github.com/shivangipatel2508/LinkedList.git
  2. Navigate to desired data structure:

    cd LinkedList/Stack
  3. Compile and run:

    gcc stack_array.c -o stack_array.exe
    stack_array.exe

💡 Key Concepts Demonstrated

  • Memory Management: Dynamic allocation and deallocation
  • Pointer Manipulation: Advanced pointer concepts and operations
  • Algorithm Efficiency: Time and space complexity considerations
  • Data Structure Design: Choosing appropriate structures for different use cases
  • Error Handling: Robust error checking and edge case management

✅ Features

  • Simple and beginner-friendly code
  • Modular and reusable functions
  • Console-based user interaction
  • Clear function names and structure
  • Comprehensive coverage of fundamental data structures
  • Well-organized folder structure for easy navigation
  • Detailed comments explaining complex operations
  • Input validation and error handling
  • Cross-platform compatibility

🧪 Testing

Each implementation includes:

  • Basic functionality tests
  • Edge case handling
  • Memory management verification
  • Performance considerations

📚 Learning Resources

This repository complements the following computer science topics:

  • Data Structures and Algorithms
  • Computer Programming in C
  • Memory Management
  • Algorithm Analysis
  • Software Design Patterns

🤝 Contributing

Feel free to contribute by:

  • Adding new data structure implementations
  • Improving existing code
  • Adding more comprehensive examples
  • Enhancing documentation
  • Reporting bugs or issues

📧 Contact

If you have any feedback or suggestions, feel free to reach out or open an issue on this repository.

📄 License

This project is open source and available under the MIT License.


About

This repository includes comprehensive implementations of fundamental data structures using the C programming language. All code is written and implemented by me with simplicity and clarity in mind.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages