From 09b95f30d78b612bc4eae9e87a4bdc195cd8b8a2 Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Tue, 8 Nov 2022 16:19:13 +0400 Subject: [PATCH] Add content for common algorithms in computer science roadmap --- .../content/103-learn-a-language/100-go.md | 1 - .../content/101-pick-a-language/104-go.md | 1 - .../100-finding-hamiltonian-paths.md | 10 +++++++++- .../101-solving-n-queen-problem.md | 9 ++++++++- .../102-maze-solving-problem.md | 10 +++++++++- .../103-knights-tour-problem.md | 10 +++++++++- .../105-back-tracking-algorithms/readme.md | 8 +++++++- .../106-robin-karp-algorithm.md | 11 ++++++++++- .../107-recursion/100-tail-recursion.md | 8 +++++++- .../107-recursion/101-non-tail-recursion.md | 12 +++++++++++- .../104-common-algorithms/107-recursion/readme.md | 12 +++++++++++- .../108-search-algorithms/100-binary-search.md | 10 +++++++++- .../108-search-algorithms/101-linear-search.md | 7 ++++++- .../108-search-algorithms/readme.md | 8 +++++++- .../109-cache-algorithms/100-lru-cache.md | 9 ++++++++- .../109-cache-algorithms/101-lfu-cache.md | 8 +++++++- .../109-cache-algorithms/102-mfu-cache.md | 8 +++++++- .../109-cache-algorithms/readme.md | 8 +++++++- .../103-binary-search-trees.md | 1 - 19 files changed, 132 insertions(+), 19 deletions(-) diff --git a/content/roadmaps/101-backend/content/103-learn-a-language/100-go.md b/content/roadmaps/101-backend/content/103-learn-a-language/100-go.md index 601a3c162..f9dd641d1 100644 --- a/content/roadmaps/101-backend/content/103-learn-a-language/100-go.md +++ b/content/roadmaps/101-backend/content/103-learn-a-language/100-go.md @@ -13,7 +13,6 @@ Go is an open source programming language supported by Google. Go can be used to A Tour of Go – Go Basics Go Reference Documentation Go by Example - annotated example programs -Learn Go | Boot.dev Learn Go | Codecademy W3Schools Go Tutorial Making a RESTful JSON API in Go diff --git a/content/roadmaps/103-computer-science/content/101-pick-a-language/104-go.md b/content/roadmaps/103-computer-science/content/101-pick-a-language/104-go.md index f0e136a68..58599560b 100644 --- a/content/roadmaps/103-computer-science/content/101-pick-a-language/104-go.md +++ b/content/roadmaps/103-computer-science/content/101-pick-a-language/104-go.md @@ -13,7 +13,6 @@ Go is an open source programming language supported by Google. Go can be used to A Tour of Go – Go Basics Go Reference Documentation Go by Example - annotated example programs -Learn Go | Boot.dev Learn Go | Codecademy W3Schools Go Tutorial Making a RESTful JSON API in Go diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/100-finding-hamiltonian-paths.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/100-finding-hamiltonian-paths.md index 98a71fb76..98f7003c3 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/100-finding-hamiltonian-paths.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/100-finding-hamiltonian-paths.md @@ -1 +1,9 @@ -# Finding hamiltonian paths \ No newline at end of file +# Finding Hamiltonian Paths + +Hamiltonian paths are paths that visit every node in a graph exactly once. They are named after the famous mathematician [Hamilton](https://en.wikipedia.org/wiki/William_Rowan_Hamilton). Hamiltonian paths are a special case of [Hamiltonian cycles](https://en.wikipedia.org/wiki/Hamiltonian_cycle), which are cycles that visit every node in a graph exactly once. + +Free Content +Hamiltonian Path +Hamiltonian Cycle | Backtracking-6 +Hamiltonian Paths and Cycles +Hamiltonian Paths - Lecture 7 diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/101-solving-n-queen-problem.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/101-solving-n-queen-problem.md index 68e09436e..dc1b033ea 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/101-solving-n-queen-problem.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/101-solving-n-queen-problem.md @@ -1 +1,8 @@ -# Solving n queen problem \ No newline at end of file +# Solving n Queen Problem + +N Queen Problem is a famous problem in Computer Science. It is a problem of placing n queens on an n x n chessboard such that no two queens attack each other. The problem is to find all possible solutions to the problem. + +Free Content +N-Queens problem using backtracking in Java/C++ +N Queen Problem | Backtracking-3 +6.1 N Queens Problem using Backtracking diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/102-maze-solving-problem.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/102-maze-solving-problem.md index b475ae904..f51c0adb6 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/102-maze-solving-problem.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/102-maze-solving-problem.md @@ -1 +1,9 @@ -# Maze solving problem \ No newline at end of file +# Maze Solving Problem + +Maze solving problem is a classic problem in computer science. It is a problem where we have to find a path from a starting point to an end point in a maze. The maze is represented as a grid of cells. Each cell can be either a wall or a path. The path cells are connected to each other. The starting point and the end point are also given. The goal is to find a path from the starting point to the end point. The path can only be made up of path cells. The path cannot go through the wall cells. + +Free Content +Maze Solving Algorithms +Maze Solving Algorithms +Maze Solving - Computerphile +Python Maze Solving Tutorial (Using Recursion) diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/103-knights-tour-problem.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/103-knights-tour-problem.md index c5a454791..81b09ba50 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/103-knights-tour-problem.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/103-knights-tour-problem.md @@ -1 +1,9 @@ -# Knights tour problem \ No newline at end of file +# Knight's Tour Problem + +Knight's Tour Problem is a problem where we have to find a path for a knight to visit all the cells of a chessboard without visiting any cell twice. + +Free Content +The Knight’s tour problem | Backtracking-1 +Knight's Tour +Knight's Tour Proble +Backtracking: The Knight’s Tour Problem diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/readme.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/readme.md index dd16a6d2d..f2dab2dbd 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/readme.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/105-back-tracking-algorithms/readme.md @@ -1 +1,7 @@ -# Back tracking algorithms \ No newline at end of file +# Back Tracking Algorithm + +Back tracking algorithms are used to solve problems that can be broken down into smaller sub-problems. The algorithm tries to solve each sub-problem and if it fails, it backtracks and tries to solve the sub-problem in a different way. + +Free Content +Backtracking Algorithms +Backtracking Algorithm diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/106-robin-karp-algorithm.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/106-robin-karp-algorithm.md index 43b357c78..a69031e7f 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/106-robin-karp-algorithm.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/106-robin-karp-algorithm.md @@ -1 +1,10 @@ -# Robin karp algorithm \ No newline at end of file +# Rabin-Karp's algorithm + +Rabin-Karp algorithm is a string searching algorithm that uses hashing to find any one of a set of pattern strings in a text. For strings of average length `n`, it performs in `O(n+m)` time with `O(m)` space, where `m` is the length of the pattern. It is often used in bioinformatics to search for DNA patterns. + +Free Content +Rabin Karp's Algorithm +Optimization: Precomputation +Optimization: Implementation and Analysis +Lecture 9: Table Doubling, Karp-Rabin +Rolling Hashes, Amortized Analysis diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/100-tail-recursion.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/100-tail-recursion.md index 3b9f47aa3..1bf292136 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/100-tail-recursion.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/100-tail-recursion.md @@ -1 +1,7 @@ -# Tail recursion \ No newline at end of file +# Tail Recursion + +Tail recursion is a special kind of recursion where the recursive call is the very last thing in the function. It's a function that does not do anything at all after recursing. + +Free Content +What is tail recursion? Why is it so bad? +Tail Recursion diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/101-non-tail-recursion.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/101-non-tail-recursion.md index cd54383c0..a89f9ed86 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/101-non-tail-recursion.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/101-non-tail-recursion.md @@ -1 +1,11 @@ -# Non tail recursion \ No newline at end of file +# Non-tail recursion + +Tail recursion is when a function can directly return the result of a recursive call - there are no outstanding operations, and there is no need for the call stack frame to be preserved. So it can be translated to a “goto with arguments”, and the stack usage will be constant. + +In “non-tail recursion”, there are outstanding operations after the recursive call, and the stack frame cannot be nuked. + +Free Content +What is non-tail recursion? +Tail vs Non-Tail Recursion +Recursion (Solved Problem 1) +Types of Recursion (Part 2) | Tail & Non-tail Recursion diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/readme.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/readme.md index a27651655..85ab45126 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/readme.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/107-recursion/readme.md @@ -1 +1,11 @@ -# Recursion \ No newline at end of file +# Recursion + +Recursion is a method of solving problems where the solution depends on solutions to smaller instances of the same problem. A recursive algorithm must have a base case. A recursive algorithm calls itself, recursively. + +Free Content +Recursion in 100 Seconds +Lecture 8 | Programming Abstractions (Stanford) +Lecture 9 | Programming Abstractions (Stanford) +Lecture 10 | Programming Abstractions (Stanford) +Lecture 11 | Programming Abstractions (Stanford) +5 Simple Steps for Solving Any Recursive Problem diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/100-binary-search.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/100-binary-search.md index 68cd29efd..cbb09f2b6 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/100-binary-search.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/100-binary-search.md @@ -1 +1,9 @@ -# Binary search \ No newline at end of file +# Binary Search + +Binary search is a search algorithm that finds the position of a target value within a sorted array. Binary search compares the target value to the middle element of the array. If they are not equal, the half in which the target cannot lie is eliminated and the search continues on the remaining half, again taking the middle element to compare to the target value, and repeating this until the target value is found. If the search ends with the remaining half being empty, the target is not in the array. + +Free Content +Binary Search in 4 Minutes +Binary Search - CS50 +Binary Search - Khan Academy +Binary Search diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/101-linear-search.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/101-linear-search.md index ec8e3b43b..2edae0cfa 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/101-linear-search.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/101-linear-search.md @@ -1 +1,6 @@ -# Linear search \ No newline at end of file +# Linear Search + +Linear search is a very simple algorithm that is used to search for a value in an array. It sequentially checks each element of the array until a match is found or until all the elements have been searched. + +Free Content +Linear Search Algorithm diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/readme.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/readme.md index 73f58ecfb..685371060 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/readme.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/108-search-algorithms/readme.md @@ -1 +1,7 @@ -# Search algorithms \ No newline at end of file +# Search Algorithms + +Search algorithms are used to find a specific item in a collection of items. For example, if you have a list of names and you want to find a specific name, you can use a search algorithm to find that name. + +Free Content +Searching Algorithms +Search Algorithms – Linear Search and Binary Search diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/100-lru-cache.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/100-lru-cache.md index 1998fef77..ef3688d9d 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/100-lru-cache.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/100-lru-cache.md @@ -1 +1,8 @@ -# Lru cache \ No newline at end of file +# LRU Cache + +LRU cache is a cache that evicts the least recently used item first. It is a very common cache algorithm. It is used in many places, such as in the browser cache, the database cache, and the cache of the operating system. + +Free Content +The Magic of LRU Cache (100 Days of Google Dev) +Implementing LRU - Udacity +LeetCode | 146 LRU Cache | C++ | Explanation diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/101-lfu-cache.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/101-lfu-cache.md index 632bc3d1d..0b2334503 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/101-lfu-cache.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/101-lfu-cache.md @@ -1 +1,7 @@ -# Lfu cache \ No newline at end of file +# LFU Cache + +LFU Cache is a data structure that stores key-value pairs. It has a fixed size and when it is full, it removes the least frequently used key-value pair. It is a variation of the LRU Cache and is used in many applications such as caching web pages, caching database queries, and caching images. + +Free Content +Least Frequently Used (LFU) Cache Implementation +1117. Data Structure - LFU Cache diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/102-mfu-cache.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/102-mfu-cache.md index 3d31a4997..c3b27dfe0 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/102-mfu-cache.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/102-mfu-cache.md @@ -1 +1,7 @@ -# Mfu cache \ No newline at end of file +# MFU Cache + +MFU Cache is a variation of the LRU Cache. The difference is that instead of deleting the least recently used entry, the MFU Cache deletes the least frequently used entry. + +Free Content +Comparison of MFU and LRU page replacement algorithms +Why does cache use Most Recently Used (MRU) algorithm as evict policy? diff --git a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/readme.md b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/readme.md index 858436c6f..57f7c0503 100644 --- a/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/readme.md +++ b/content/roadmaps/103-computer-science/content/104-common-algorithms/109-cache-algorithms/readme.md @@ -1 +1,7 @@ -# Cache algorithms \ No newline at end of file +# Cache Algorithms + +Cache algorithms are used to manage the cache memory of a computer. Cache memory is a small amount of memory that is used to store data that is frequently accessed. This allows the computer to access the data faster than if it had to go to the main memory. Cache algorithms are used to determine which data should be stored in the cache memory and which data should be removed from the cache memory. + +Free Content +Cache Replacement Algorithms: How To Efficiently Manage The Cache Storage +14. Caching and Cache-Efficient Algorithms diff --git a/content/roadmaps/108-python/content/101-data-structures-and-algorithms/103-binary-search-trees.md b/content/roadmaps/108-python/content/101-data-structures-and-algorithms/103-binary-search-trees.md index 7093ae131..350f857cc 100644 --- a/content/roadmaps/108-python/content/101-data-structures-and-algorithms/103-binary-search-trees.md +++ b/content/roadmaps/108-python/content/101-data-structures-and-algorithms/103-binary-search-trees.md @@ -4,7 +4,6 @@ A binary search tree, also called an ordered or sorted binary tree, is a rooted Free Content Tree Data Structure | Illustrated Data Structures -Writing a Binary Search Tree in Python with Examples How to Implement Binary Search Tree in Python Problem Set