Skip to content

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.

Notifications You must be signed in to change notification settings

AthulSabu2002/S3_DS_LAB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

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:

    git clone https://github.com/AthulSabu2002/S3_DS_LAB.git
    cd dsa-lab
  2. Compile any program:

    gcc filename.c -o output
  3. Run the executable:

    ./output

πŸ’‘ Example Usage

# 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

About

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.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages