Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tirthasheshpatel/data-structures-and-algorithms
Find any Algorithms and Data Structure implemented in C/C++ here!
https://github.com/tirthasheshpatel/data-structures-and-algorithms
algorithms algorithms-and-data-structures beginner data-structures
Last synced: 2 months ago
JSON representation
Find any Algorithms and Data Structure implemented in C/C++ here!
- Host: GitHub
- URL: https://github.com/tirthasheshpatel/data-structures-and-algorithms
- Owner: tirthasheshpatel
- License: mit
- Created: 2019-08-03T10:01:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-12-06T03:05:19.000Z (about 5 years ago)
- Last Synced: 2024-10-04T23:22:39.691Z (3 months ago)
- Topics: algorithms, algorithms-and-data-structures, beginner, data-structures
- Language: C
- Homepage:
- Size: 37.2 MB
- Stars: 18
- Watchers: 2
- Forks: 13
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Data-Structures-and-Algorithms
This project is meant to help beginners understand and code Data Structures and Algorithms
in C. This project strictly follows the book `Introduction to Algorithms` by Thomas H. Cormen.
Any beginners strugling with Data Structures and Algorithms are highly recommended to follow
the book. Most of the code is documented properly for beginner audiences to understand easily.
Minimum utilities and libraries are used in case the targeted audience ins't familiar with them.This project is still in development stage and needs more contributors.
Read contributing guidelines in case you want to contribute to this project.
## Algorithms Implemented
Algorithms have been mostly implemented in C++ and partially documented. The algorithms implemented are:
- Insertion Sort. (location: Algorithms.cpp, line on:[150-165])
- Heap Sort (location: Algorithms.cpp, line no:[331-342])
- Quick Sort (location: Algorithms.cpp, line no:[368-378])
- Randomized Quick Sort (location: Algorithms.cpp, line no:[360-366])
- Counting Sort (location: Algorithms.cpp, line no:[392-408])
- Merge Sort (location: Algorithms.cpp, line no:[410-467])
- Selection Sort (location: Algorithms.cpp, line no:[484-500])
- Bubble Sort (location: Algorithms.cpp, line no:[474-482])
- Linear Search (location: Algorithms.cpp, line no:[133-143])
- Binary Search (location: Algorithms.cpp, line no:[111-124])
- Maximum Subarry Problem solved using brute forse, devide and concour and linear methods. (location: Algorithms.cpp, line no:[582-691])
- Infix to Reverse Polish (postfix) using STACK in C (location: infix_to_postfix/main.c)
- Infix to Polish (prefix) using STACK in C (location: infix_to_prefix/main.c)
- Reverse Polish (postfix) to Polish (prefix) using STACK in C (location: postfix_to_prefix/main.c)
- Reverse Polish (postfix) to Infix using STACK in C (location: postfix_to_infix/main.c)
- Polish (prefix) to Reverse Polish (postfix) using STACK in C (location: prefix_to_postfix/main.c)
- Polish (prefix) to Infix using STACK in C (location: profix_to_infix/main.c)
All the algorithms will be fully documented and implemented in C soon!
## Data Structures ImplementedAll the Data Structures have been implemented in C. The implemented Data Structures are:
- Stack (fully documented) (C implementation: stack_as_static_array.c, C++ implementtation: stack/stack/headers/Stack.h)
- Queue (documented) (C implementation: queue_using_static_array.c, C++ implementtation: queue/queue/headers/Queue.h)
- Heap (documented) (location: Algorithms.cpp, line no:[168-342])
- Priority Queue (documented) (C implementation: priority_queue.c, C++ implementation: Algorithms.cpp, line no:[168-342])
- Circular Queue (undocumented) (location: circular_queue_uaing_static_array.c)
- Binary Search Trees (undocumented) (location: binary_tree.c)
- Doubly Linked List (fully documented) (location: doubly_linked_list.c)
- Direct Address Tables (undocumented) (location: direct_address_tables.c)
- Hash Tables (fully documented) (location: hash_tables.c)
Dynamic Programming
Currently under devlopment, some of the Dynamic and Greedy Algoruthms have been implemented in this section. The implementations include:
- Fibonacci Series
- Rod Cutting Problem
- Matrix Chain Multiplication Problem
- Longest Common Subsequence Problem
When does Dynamic Algorithm apply?
- optimal substructure.
- Property of independence holds.
- Property of linearity holds.
- Choices hold both for subproblems and problems.
- overlapping subproblems.
Elements of Dynamic Programming:
- Optimal Substucture.
- Overlapping Subproblems.
- Reconstructing a optimal solution.
- Memoization for top-down approach.
Attack plan:
- Characterize the stucture of an optimum solution.
- Recursively define the value of an optimum solution.
- Compute the value of optimum solution.
- Construct an optimal solution from computed information.
Examples:
- Rod cutting Problem.
- Matrix Chain Multiplication.
- Shortest Path in unweighed directed graph.
- Longest Common Sub-Sequence.
Where it doesn't apply:
- Longest Path in unweighed directed graph.
- Rod cutting with limit of cuts.
## Thanking you!
Please read the contributing guidelines if you wish to contribute!