Data-Structures-using-C

Data Structures using C

Lab Coverage Beginner Friendly Open Source

A Theoretical Repobook for Understanding core concepts of Data Structures using C Programming Language


About This Repository

Backstory:

| | | | - | -

Vision:

This repository is designed to be the ultimate, all-in-one resource for mastering Data Structures using C. It combines:

Whether you are a student, self-learner, or educator, this repo aims to make learning and teaching Data Structures in C practical, accessible, and exam-ready.

Key Features:


How to Use This Repo

Tip: Use the Table of Contents below to jump to any section instantly!


Table of Contents

The Curriculum

Topic Details
Unit I: Introduction Data Structures
Classifications (Primitive & Non Primitive)
Data structure Operations
Review of Arrays
Structures, Self-Referential Structures, and Unions
Unit I: Pointers and Dynamic Memory Allocation Functions Representation of Linear Arrays in Memory
Dynamically allocated arrays
Multidimensional Arrays
Polynomials and Sparse Matrices
Unit I: Strings Basic Terminology
Storing
Operations and Pattern Matching algorithms
Unit I: Sorting and Searching Insertion Sort
Radix sort
Address Calculation C Programming Examples Sort
Unit II: Stacks and Queues Definition
Stack Operations
Array Representation of Stacks
Stacks using Dynamic Arrays
Unit II: Stack Applications Polish notation
Infix to postfix conversion
Evaluation of postfix expression
Unit II: Recursion Factorial
GCD
Fibonacci Sequence
Tower of Hanoi
Ackerman’s function
Unit II: Queues Definition
Array Representation
Queue Operations
Circular Queues
Circular queues using Dynamic arrays
Dequeues
Priority Queues
A Mazing Problem
Unit III: Linked Lists Definition
Representation of linked lists in Memory
Memory allocation
Garbage Collection
Linked list operations: Traversing, Searching, Insertion, and Deletion
Doubly Linked lists
Circular linked lists
Header linked lists
Linked Stacks and Queues
Applications of Linked lists – Polynomials, Sparse matrix representation
Unit III: Hashing Hash Table organizations
Hashing Functions
Static and Dynamic Hashing
Unit IV: Trees Terminology
Binary Trees
Properties of Binary trees
Array and linked Representation of Binary Trees
Binary Tree Traversals: Inorder, Postorder, Preorder
Additional Binary tree operations
Threaded binary trees
Binary Search Trees – Definition, Insertion, Deletion, Traversal, Searching
Application of Trees-Evaluation of Expression
Unit V: Graphs Definitions
Terminologies
Types of Graphs
Matrix and Adjacency List Representation Of Graphs
Elementary Graph operations
Unit V: Minimal Spanning Tree Prim’s algorithm
Kruskal’s Algorithm
Unit V: Traversal methods Breadth First Search
Depth First Search
Unit V: Applications of Graph Applications of Graph
Unit V: Files and Their Organization Data Hierarchy
File Attributes
Text Files and Binary Files
Basic File Operations
File Organizations and Indexing

📚 See also: Curriculum to Notes Mapping (Unified Table) for direct links to notes and resources for each topic.


Data Structures using C Lab Programs

Lab 1: Demonstrating Pointers Usage

  1. Printing Memory Addresses: Write C program to demonstrate the use of pointers by printing memory address
  2. Writing a Swap Function: Write a C program to swap two numbers using pointers concept
  3. Allocating and Freeing Memory: Write a C program to demonstrate the use of allocating a memory and freeing
  4. Memory Leaks and Other Problems: Write a C program to demonstrate the memory leaks when pointers are not used properly.

Lab 2: Demonstrate Strings, User defined data types and Files in C

  1. Reading and Writing Strings: Write a C program to demonstrate the input and output operations on strings
  2. String operations / Manipulations: Write a C program to demonstrate the operations on strings – by writing user defined string functions.
  3. Enumerations, Structures and Union: Write a C program to demonstrate Enumerations, Structures and Union data types. Write a program for following using recursive methods.
  4. File operations: Write a C program to demonstrate the input and output operations on files

Lab 3: Demonstrate the technique of recursion in C

  1. Recursion – Write recursive function for i) Sum of natural numbers ii) Factorial of a given number iii) Fibonacci sequence

Lab 4: Stack ADT Implement Stack using Arrays

Lab 5: Queue ADT Implement Queue using Arrays

Lab 6: Singly Linked List Write a C Program to perform following operations on Singly Linked List ADT: i. Create ii. Insert iii. Delete iv. Display

Lab 7: Doubly Linked List Write a C Program to perform following operations on Doubly Linked List ADT: i. Create ii. Insert iii. Delete iv. Display

Lab 8: Circular Linked List Write a C Program to perform following operations on Circular Linked List ADT: i. Create ii. Insert iii. Delete iv. Display

Lab 9: Implement Stack using List

Lab 10: Implement Queue using List

Lab 11: Implement Binary Search Tree – using List

Lab 12: i) Implement a Simple Heap ii) Implement Priority Queue using Heap

💻 See also: Lab Program Aims to Code Mapping for direct links to C code for each lab aim.


Table of Contents

Data Structures using C Lab

Lab 1 - Pointers

Lab 2 - Strings and User Defined Data Types

Lab 3 - Recursion

Lab 4 - Stack ADT

Lab 5 - Queue ADT

Lab 6 - Singly Linked list ADT

Lab 7 - Doubly Linked list ADT

Lab 8 - Circular Linked list ADT

Lab 9 - Implement Stack using List

Lab 10 - Implement Queue using List

Lab 11 - Implement Binary Search Tree using List

Lab 12 a - Implement a Simple Heap

Lab 12 b - Implement Priority Queue using Heap

Data Structures using C Notes

📝 See also: Curriculum to Notes Mapping (Unified Table) for a topic-wise mapping to notes and resources.

Data Structures using C Syllabus

Data Structures using C Question Bank

Data Structures using C Assignments

Data Structures using C Internals

Data Structures using C Lab Notes

LICENSE


Curriculum to Notes Mapping (Unified Table)

This table maps each curriculum topic and subtopic from the README to the most relevant notes, PDFs, or documents in this repository. Each topic is linked to the best available resource(s) for easy reference.

Topic Resource
__Unit I__  
__Introduction__  
Data Structures, Classifications, Operations 1.Unit_1-Introduction.pdf — Overview
Structures, Self-Referential Structures, Unions I Structures Notes.docx — Details
I Self Referential Structures.pdf
Comprehensive Notes I Notes.pdf
__Pointers and Dynamic Memory Allocation__  
Pointers, Dynamic Memory, Arrays 2.Unit_1-Pointers _ Dynamic memory alloction.pdf
Additional Notes I_II Missing Concepts.pdf
__Strings__  
Pattern Matching, String Operations 3.Unit_1-Pattern Matching Algorithms.pdf
In-depth Pattern Matching PatternMatching.pdf
__Sorting and Searching__  
Searching and Sorting Algorithms 4.Unit_1-Searching _ Sorting.pdf
Radix Sort 5.Radix Sort.pdf
Reference Algorithms 2.Intoduction to Algorithm - Cormen.pdf
__Unit II__  
__Stacks and Queues__  
Stack Operations, Array/Dynamic Representation 6.Unit_2-Stacks.pdf
Stacks, Queues, Applications II Stacks and Queues Notes.pdf
Queue Operations and Types 8.Queue.pdf
__Stack Applications__  
Polish Notation, Infix/Postfix, Evaluation 6.Unit_2-Stacks.pdf
__Recursion__  
Recursion, Classic Problems 7.Unit_2-Recurssion.pdf
__Queues (continued)__  
Circular Queues, Dequeue, Priority Queues, Mazing Problem 8.Queue.pdf
__Unit III__  
__Linked Lists__  
Linked List Types, Operations, Memory Management III Notes Linked Lists.pdf
Additional Notes I_II Missing Concepts.pdf
__Doubly, Circular, and Header Linked Lists__  
All Types III Notes Linked Lists.pdf
__Linked Stacks and Queues, Applications__  
Applications III Notes Linked Lists.pdf
__Hashing__  
Hash Tables, Functions, Static/Dynamic Hashing III Hashing.pdf
__Unit IV__  
__Trees__  
Binary Trees, Properties, Traversals, Operations IV Notes Tree.pdf
Tree Algorithms and Applications IV Agorithms.pdf
__Binary Search Trees, Threaded Trees, Expression Evaluation__  
BST, Threaded Trees, Expression Evaluation IV Notes Tree.pdf
__Unit V__  
__Graphs__  
Graph Definitions, Types, Representations, Operations V 1.Notes_1.pdf
Additional Graph Notes V 1.Notes_2.docx
__Minimal Spanning Tree, Traversal Methods, Applications__  
MST, Traversal, Applications V 1.Notes_1.pdf
__Files and Their Organization__  
File Organization and Operations I Notes.pdf
__Syllabus, Question Banks, Assignments, and Internals__  
__Syllabus__  
Official Syllabus Data Structures Using C Theory & Lab Syllabus.pdf
__Question Banks__  
Units I & II I_II QB.pdf
Units III & IV III, IV QB_LINKEDLISTS_TREES.pdf
__Assignments__  
Sample Assignment 5.I Assignment.docx
__Internal Assessment Solutions__  
IA-I Solution 1 0.IA-I Soln_1.docx
IA-I Solution 2 0.IA-I Soln_2.docx
IA-II Solution 0.IA-II Soln.docx
IA-III Solution 0.IA-III Soln.docx

For more detailed lab experiment notes, see the Data Structures using C Lab Notes folder.


Lab Program Aims to Code Mapping

This table maps each lab program aim from the curriculum to the corresponding C code file(s) in this repository. Each code file is linked for easy access.

Lab Aim Code File(s)
__Lab 1: Demonstrating Pointers Usage__  
Printing Memory Addresses PointersMemoryAddresses.c
Writing a Swap Function PointersSwap.c
Allocating and Freeing Memory PointersAllocationFreeing.c
Memory Leaks and Other Problems PointersMemoryLeaks.c
__Lab 2: Strings, User Defined Data Types, and Files__  
Reading and Writing Strings StringOperationsLibraryFunctions.c
String Operations / Manipulations (User Defined) StringOperationsUserDefinedFunctions.c
Enumerations, Structures UsingStructure.c
Union Data Types UsingUnion.c
File Operations FileOperations.c
__Lab 3: Recursion__  
Recursion (Sum, Factorial, Fibonacci, etc.) RecursiveFunstionsOfClassicProblems.c
__Lab 4: Stack ADT (Arrays)__  
Stack Operations using Arrays StackADT.c
__Lab 5: Queue ADT (Arrays)__  
Queue Operations using Arrays QueueADT.c
__Lab 6: Singly Linked List ADT__  
Create, Insert, Delete, Display (Singly Linked List) SinglyLinkedListADT.c
__Lab 7: Doubly Linked List ADT__  
Create, Insert, Delete, Display (Doubly Linked List) DoublyLinkedListADT.c
__Lab 8: Circular Linked List ADT__  
Create, Insert, Delete, Display (Circular Linked List) CircularLinkedListADT.c
__Lab 9: Implement Stack using List__  
Stack using Linked List StackUsingList .c
__Lab 10: Implement Queue using List__  
Queue using Linked List QueueUsingList.c
__Lab 11: Implement Binary Search Tree using List__  
Binary Search Tree using List BinarySearchTreeUsingList.c
__Lab 12a: Implement a Simple Heap__  
Simple Heap SimpleHeap.c
__Lab 12b: Implement Priority Queue using Heap__  
Priority Queue using Heap PriorityQueueUsingHeap.c

How to Contribute

We welcome contributions to make this resource even better!

Steps to contribute:

  1. Fork this repository
  2. Create a new branch for your changes
  3. Make your edits and commit
  4. Open a pull request with a clear description

For major changes, please open an issue first to discuss what you would like to change.



FAQ / Troubleshooting

Q: How do I compile and run the C programs? A: Use a C compiler like GCC. Example: gcc filename.c -o output && ./output

Q: Can I use these notes and code for my university assignments? A: Yes! This repo is designed for learning and academic use. Please cite or reference if required by your institution.

Q: I found a mistake or have a suggestion. What should I do? A: Open an issue or submit a pull request. See How to Contribute.

Q: Are there solutions to all lab programs? A: Yes, all standard lab programs are covered with code and notes.


Changelog / Version History

Version Date Commit Changes
v3.0 Jun 21, 2025 Major README overhaul, curriculum/code/notes mapping, TOC, contribution guide, added unified tables, improved linking
v2.0 Jan 8, 2022 Resource Addition: DS using C Lab & Notes & Documentation Update
v1.0 Dec 29, 2021 Initial compilation of notes and code