An open API service indexing awesome lists of open source software.

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.

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
./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 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*