Skip to content

anik-paul-dev/Data-Structure-C

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data Structures and Algorithms in C

This repository contains a collection of C programs that I prepared while learning data structures. The programs cover various fundamental and advanced concepts, providing hands-on experience with data structures and algorithms in C.


Table of Contents

  1. Pattern Matching Algorithms
  2. Array Operations
  3. Sorting Algorithms
  4. Linked List Operations
  5. Stack Operations
  6. Queue Operations and Sorting
  7. Binary Tree Operations
  8. Binary Search and Related Problems
  9. Tree Construction

1. Pattern Matching Algorithms

  • Pattern Matching Algorithm
    • Implements basic pattern matching in a string.
  • Pattern Matching Algorithm (Optimized)
    • Improved version with better complexity.

2. Array Operations

  • Insert Element into Array
    • Inserts an element at a specified position in an array.
  • Delete Element from Array
    • Deletes an element at a specified position in an array.
  • Binary Search
    • Finds the position of a specified element in a sorted array.

3. Sorting Algorithms

  • Insertion Sort
    • Sorts an array of integers in ascending order.
  • Kth Largest Element
    • Finds the Kth largest element in an array.
  • Relative Sort Array
    • Sorts an array relative to another array.
  • Sort Array by Parity
    • Sorts an array, grouping even numbers before odd numbers.

4. Linked List Operations

  • Print Linked List
    • Prints all elements in a linked list.
  • Insert Node
    • Inserts a node at the beginning or end of a linked list.
  • Delete Node
    • Deletes a node with a specific value.
  • Add Value to Elements
    • Adds a given value K to each element in a linked list.

5. Stack Operations

  • Stack Implementation
    • Implements a stack using a linear array.
  • Postfix Expression Evaluation
    • Evaluates a postfix expression using a stack.
  • Infix to Postfix Conversion
    • Converts an infix expression to a postfix expression using a stack.

6. Queue Operations and Sorting

  • Queue Implementation
    • Implements enqueue and dequeue operations.
  • Pre-order Traversal
    • Implements pre-order traversal of a binary tree.
  • Quick Sort
    • Sorts an array using the Quick Sort algorithm.

7. Binary Tree Operations

  • In-order Traversal
    • Implements in-order traversal of a binary tree.
  • Post-order Traversal
    • Implements post-order traversal of a binary tree.
  • Search and Insert in BST
    • Searches and inserts elements in a Binary Search Tree (BST).

8. Binary Search and Related Problems

  • Binary Search
    • Efficiently searches for a target element in a sorted array.
  • First and Last Occurrences
    • Finds the first and last occurrences of a target in a sorted array.
  • Insert Position
    • Determines the appropriate insert position for a target in a sorted array.
  • Peak Element
    • Identifies a peak element in an array using Binary Search.

9. Tree Construction

  • Construct Tree from Traversals
    • Constructs a tree from given In-order and Pre-order traversals.

Usage

  1. Clone the repository:

    git clone https://github.com/your-username/your-repo-name.git
  2. Navigate to the directory:

    cd your-repo-name
  3. Compile and run any program:

    gcc filename.c -o output
    ./output

Contributing

Contributions are welcome! If you have suggestions for improvements or new programs to add, feel free to submit a pull request.


Happy Coding!😊

About

Data Structure using C

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages