https://github.com/athulsabu2002/s3_ds_lab
Data Structures and Algorithms lab programs for S3 CSE B.Tech. Comprehensive implementation of sorting algorithms, linear/non-linear data structures, graph algorithms, and mathematical applications in C.
https://github.com/athulsabu2002/s3_ds_lab
data-structures ktu lab s3
Last synced: about 2 months ago
JSON representation
Data Structures and Algorithms lab programs for S3 CSE B.Tech. Comprehensive implementation of sorting algorithms, linear/non-linear data structures, graph algorithms, and mathematical applications in C.
- Host: GitHub
- URL: https://github.com/athulsabu2002/s3_ds_lab
- Owner: AthulSabu2002
- Created: 2023-09-07T06:43:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-28T13:12:38.000Z (3 months ago)
- Last Synced: 2025-08-02T23:02:03.932Z (2 months ago)
- Topics: data-structures, ktu, lab, s3
- Language: C
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Data Structures and Algorithms Lab š
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.
## š Programs Included
### š Searching Algorithms
- **Binary Search** - `binarySearch.c`### š Sorting Algorithms
- **Bubble Sort** - `bubbleSort.c`
- **Selection Sort** - `selectionSort.c`
- **Insertion Sort** - `insertionSort.c`
- **Merge Sort** - `mergeSort.c`
- **Quick Sort** - `quickSort.c`
- **Heap Sort** - `heapSort.c`### š Linear Data Structures
- **Queue Implementation** - `queue.c`
- **Circular Queue** - `circularQueue.c`
- **Singly Linked List** - `singlyLinkedList.c`
- **Linked List Queue** - `singlyLinkedListQueue.c`### š³ Non-Linear Data Structures
- **Binary Tree** - `binaryTree.c`
- **Hash Table** - `hashTable.c`### š¢ Mathematical Applications
- **Polynomial Representation** - `polynomialRepresentation.c`
- **Polynomial Addition (Linked List)** - `polynomialAddnLinkedList.c`
- **Sparse Matrix** - `sparseMatrix.c`### š Expression Processing
- **Infix to Postfix Conversion** - `infixToPostfix.c`### š Graph Algorithms
- **DFS & BFS Traversal** - `dfs_bfs.c`## šÆ Course Information
- **Course**: Data Structures and Algorithms Lab
- **Semester**: 3rd Semester
- **Program**: B.Tech Computer Science Engineering
- **Language**: C Programming## š Getting Started
### Prerequisites
- GCC Compiler
- Basic knowledge of C programming
- Understanding of data structures concepts### Installation & Usage
1. **Clone the repository**:
```bash
git clone https://github.com/AthulSabu2002/S3_DS_LAB.git
cd dsa-lab
```2. **Compile any program**:
```bash
gcc filename.c -o output
```3. **Run the executable**:
```bash
./output
```## š” Example Usage
```bash
# Sorting Algorithms
gcc bubbleSort.c -o bubblesort
./bubblesortgcc mergeSort.c -o mergesort
./mergesort# Data Structures
gcc singlyLinkedList.c -o linkedlist
./linkedlistgcc 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 Complexity Overview
### Sorting Algorithms
| 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) |### Searching Algorithms
| Algorithm | Best Case | Average Case | Worst Case |
|-----------|-----------|--------------|------------|
| Binary Search | O(1) | O(log n) | O(log n) |## š§ Data Structures Implemented
### Linear Structures
- **Queue**: FIFO (First In, First Out) operations
- **Circular Queue**: Efficient space utilization with circular indexing
- **Linked List**: Dynamic memory allocation with pointer-based structure### Non-Linear Structures
- **Binary Tree**: Hierarchical data organization
- **Hash Table**: Key-value pair storage with hashing
- **Graph**: Vertex and edge representation for network problems### Specialized Structures
- **Sparse Matrix**: Efficient storage for matrices with many zeros
- **Polynomial**: Mathematical polynomial representation and operations## š ļø Key Concepts Covered
### Algorithm Design Techniques
- **Divide and Conquer**: Merge Sort, Quick Sort
- **Greedy Approach**: Selection Sort
- **Dynamic Programming**: Optimal substructure problems### Data Structure Operations
- **Insertion and Deletion**: In various data structures
- **Traversal**: Tree and graph traversal algorithms
- **Searching**: Efficient search techniques### Mathematical Applications
- **Polynomial Operations**: Addition using linked lists
- **Matrix Operations**: Sparse matrix representation
- **Expression Evaluation**: Infix to postfix conversion## š Learning Outcomes
- 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## š Academic Context
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.
## š ļø Technologies Used
- **C Programming Language**
- **GCC Compiler**
- **Standard C Libraries**
- **Manual Memory Management**## š¤ Contributing
This repository contains academic lab work. For improvements or additional implementations:
1. Fork the repository
2. Create a feature branch
3. Add your improvements
4. Submit a pull request## š Note
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.
## š§ Contact
For questions about algorithm implementations or data structure concepts, feel free to reach out!
---
*S3 CSE B.Tech - Data Structures and Algorithms Laboratory*