Data Structures and Algorithms lab programs implemented in C for S3 CSE B.Tech curriculum. This repository contains comprehensive implementations of fundamental data structures, sorting algorithms, searching techniques, and graph algorithms.
- Binary Search -
binarySearch.c
- Bubble Sort -
bubbleSort.c - Selection Sort -
selectionSort.c - Insertion Sort -
insertionSort.c - Merge Sort -
mergeSort.c - Quick Sort -
quickSort.c - Heap Sort -
heapSort.c
- Queue Implementation -
queue.c - Circular Queue -
circularQueue.c - Singly Linked List -
singlyLinkedList.c - Linked List Queue -
singlyLinkedListQueue.c
- Binary Tree -
binaryTree.c - Hash Table -
hashTable.c
- Polynomial Representation -
polynomialRepresentation.c - Polynomial Addition (Linked List) -
polynomialAddnLinkedList.c - Sparse Matrix -
sparseMatrix.c
- Infix to Postfix Conversion -
infixToPostfix.c
- DFS & BFS Traversal -
dfs_bfs.c
- Course: Data Structures and Algorithms Lab
- Semester: 3rd Semester
- Program: B.Tech Computer Science Engineering
- Language: C Programming
- GCC Compiler
- Basic knowledge of C programming
- Understanding of data structures concepts
-
Clone the repository:
git clone https://github.com/AthulSabu2002/S3_DS_LAB.git cd dsa-lab -
Compile any program:
gcc filename.c -o output
-
Run the executable:
./output
# Sorting Algorithms
gcc bubbleSort.c -o bubblesort
./bubblesort
gcc mergeSort.c -o mergesort
./mergesort
# Data Structures
gcc singlyLinkedList.c -o linkedlist
./linkedlist
gcc binaryTree.c -o binarytree
./binarytree
# Search Algorithm
gcc binarySearch.c -o binarysearch
./binarysearch
# Graph Algorithms
gcc dfs_bfs.c -o graph_traversal
./graph_traversal| Algorithm | Best Case | Average Case | Worst Case | Space |
|---|---|---|---|---|
| Bubble Sort | O(n) | O(nΒ²) | O(nΒ²) | O(1) |
| Selection Sort | O(nΒ²) | O(nΒ²) | O(nΒ²) | O(1) |
| Insertion Sort | O(n) | O(nΒ²) | O(nΒ²) | O(1) |
| Merge Sort | O(n log n) | O(n log n) | O(n log n) | O(n) |
| Quick Sort | O(n log n) | O(n log n) | O(nΒ²) | O(log n) |
| Heap Sort | O(n log n) | O(n log n) | O(n log n) | O(1) |
| Algorithm | Best Case | Average Case | Worst Case |
|---|---|---|---|
| Binary Search | O(1) | O(log n) | O(log n) |
- Queue: FIFO (First In, First Out) operations
- Circular Queue: Efficient space utilization with circular indexing
- Linked List: Dynamic memory allocation with pointer-based structure
- Binary Tree: Hierarchical data organization
- Hash Table: Key-value pair storage with hashing
- Graph: Vertex and edge representation for network problems
- Sparse Matrix: Efficient storage for matrices with many zeros
- Polynomial: Mathematical polynomial representation and operations
- Divide and Conquer: Merge Sort, Quick Sort
- Greedy Approach: Selection Sort
- Dynamic Programming: Optimal substructure problems
- Insertion and Deletion: In various data structures
- Traversal: Tree and graph traversal algorithms
- Searching: Efficient search techniques
- Polynomial Operations: Addition using linked lists
- Matrix Operations: Sparse matrix representation
- Expression Evaluation: Infix to postfix conversion
- Understanding of fundamental data structures
- Implementation of various sorting algorithms
- Graph traversal techniques (DFS, BFS)
- Time and space complexity analysis
- Problem-solving using appropriate data structures
- Memory management in C programming
This repository demonstrates practical implementation of:
- Abstract Data Types (ADT)
- Algorithm efficiency and optimization
- Memory management techniques
- Problem decomposition strategies
Each program includes detailed comments and follows structured programming practices.
- C Programming Language
- GCC Compiler
- Standard C Libraries
- Manual Memory Management
This repository contains academic lab work. For improvements or additional implementations:
- Fork the repository
- Create a feature branch
- Add your improvements
- Submit a pull request
These programs are implemented for educational purposes as part of the DSA Lab curriculum. Each implementation focuses on clarity and understanding of the underlying concepts rather than production optimization.
For questions about algorithm implementations or data structure concepts, feel free to reach out!
S3 CSE B.Tech - Data Structures and Algorithms Laboratory