Add tree algorithms content

pull/2901/head
Kamran Ahmed 2 years ago
parent 7d4d390b64
commit e2b1d4b6bc
  1. 9
      content/roadmaps/103-computer-science/content/104-common-algorithms/100-sorting-algorithms/102-insertion-sort.md
  2. 17
      content/roadmaps/103-computer-science/content/104-common-algorithms/100-sorting-algorithms/103-heap-sort.md
  3. 11
      content/roadmaps/103-computer-science/content/104-common-algorithms/100-sorting-algorithms/104-quick-sort.md
  4. 10
      content/roadmaps/103-computer-science/content/104-common-algorithms/100-sorting-algorithms/105-merge-sort.md
  5. 8
      content/roadmaps/103-computer-science/content/104-common-algorithms/101-tree-algorithms/100-pre-order-traversal.md
  6. 8
      content/roadmaps/103-computer-science/content/104-common-algorithms/101-tree-algorithms/101-in-order-traversal.md
  7. 8
      content/roadmaps/103-computer-science/content/104-common-algorithms/101-tree-algorithms/102-post-order-traversal.md
  8. 9
      content/roadmaps/103-computer-science/content/104-common-algorithms/101-tree-algorithms/103-breadth-first-search.md
  9. 9
      content/roadmaps/103-computer-science/content/104-common-algorithms/101-tree-algorithms/104-depth-first-search.md
  10. 13
      content/roadmaps/103-computer-science/content/104-common-algorithms/101-tree-algorithms/readme.md

@ -1 +1,8 @@
# Insertion sort
# Insertion Sort
Insertion sort is a simple sorting algorithm that builds the final sorted array one item at a time by comparisons. It is much less efficient on large lists than more advanced algorithms such as quicksort, heapsort, or merge sort.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=Kg4bqzAqRBM&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=4'>Insertion Sort — MIT</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=JU767SDMDvA'>Insertion Sort in 3 Minutes</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.programiz.com/dsa/insertion-sort'>Insertion Sort Algorithm</BadgeLink>

@ -1 +1,16 @@
# Heap sort
# Heap Sort
Heap sort is a comparison based sorting algorithm. It is similar to selection sort where we first find the maximum element and place the maximum element at the end. We repeat the same process for remaining element.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.programiz.com/dsa/heap-sort'>Heap Sort Algorithm</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/heap-sort/'>Heap Sort Algorithm - Geeks for Geeks</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=2DmK_H7IdTo'>Heap Sort in 4 Minutes</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=odNJmw5TOEE&list=PLFDnELG9dpVxQCxuD-9BSy2E7BWY3t5Sm&t=3291s'>Heap Sort Algorithm - MIT</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.coursera.org/lecture/data-structures/heap-sort-hSzMO'>Heap Sort Algorithm</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=B7hVxCmfPtM&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb&index=5'>Lecture 4 - Heaps and Heap Sort</BadgeLink>

@ -1 +1,10 @@
# Quick sort
# Quick Sort
Quick Sort is a divide and conquer algorithm. It picks an element as pivot and partitions the given array around the picked pivot. There are many different versions of quickSort that pick pivot in different ways.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.programiz.com/dsa/quick-sort'>Quick Sort Algorithm</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/quick-sort/'>Quick Sort Algorithm - Geeks for Geeks</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=Hoixgm4-P4M&feature=youtu.be'>Quick Sort in 4 Minutes</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='http://www.cs.yale.edu/homes/aspnes/classes/223/examples/randomization/quick.c'>Quick Sort Implementaiton in C</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://github.com/jwasham/practice-python/blob/master/quick_sort/quick_sort.py'>Quick Sort Implementation in Python</BadgeLink>

@ -1 +1,9 @@
# Merge sort
# Merge Sort
Merge sort is a divide and conquer algorithm. It divides the input array into two halves, calls itself for the two halves, and then merges the two sorted halves. The `merge()` function is used for merging two halves. The `merge(arr, l, m, r)` is key process that assumes that `arr[l..m]` and `arr[m+1..r]` are sorted and merges the two sorted sub-arrays into one.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/merge-sort/'>Merge Sort - Geeks for Geeks</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.programiz.com/dsa/merge-sort'>Merge Sort Algorithm</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/merge-sort-for-linked-list/'>Merge Sort for Linked Lists</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=4VqmGXwpLqc'>Merge Sort in 3 Minutes</BadgeLink>

@ -1 +1,7 @@
# Pre order traversal
# Pre-Order Traversal
Pre-order traversal is a tree traversal algorithm that visits the root node first, then recursively traverses the left subtree, followed by the right subtree.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=S2W3SXGPVyU'>Tree | Illustrated Data Structures</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/'>Tree Traversals (Inorder, Preorder and Postorder)</BadgeLink>

@ -1 +1,7 @@
# In order traversal
# In-Order Traversal
In-order traversal is a tree traversal algorithm that visits the left subtree, the root, and then the right subtree. This is the most common way to traverse a binary search tree. It is also used to create a sorted list of nodes in a binary search tree.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=S2W3SXGPVyU'>Tree | Illustrated Data Structures</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/'>Tree Traversals (Inorder, Preorder and Postorder)</BadgeLink>

@ -1 +1,7 @@
# Post order traversal
# Post-Order Traversal
Post-order traversal is a type of tree traversal that visits the left subtree, then the right subtree, and finally the root node. This is the opposite of pre-order traversal, which visits the root node first, then the left subtree, and finally the right subtree.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=S2W3SXGPVyU'>Tree | Illustrated Data Structures</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.geeksforgeeks.org/tree-traversals-inorder-preorder-and-postorder/'>Tree Traversals (Inorder, Preorder and Postorder)</BadgeLink>

@ -1 +1,8 @@
# Breadth first search
# Breadth First Search
Breadth first search is a graph traversal algorithm that starts at the root node and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=uWL6FJhq5fM'>BFS and DFS in a Binary Tree</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.digitalocean.com/community/tutorials/breadth-first-search-depth-first-search-bfs-dfs'>Breadth-First Search (BFS) and Depth-First Search (DFS) for Binary Trees in Java</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=HZ5YTanv5QE'>Breadth-first search in 4 minutes</BadgeLink>

@ -1 +1,8 @@
# Depth first search
# Depth First Search
Depth first search is a graph traversal algorithm that starts at a root node and explores as far as possible along each branch before backtracking.
<ResourceGroupTitle>Free Content</ResourceGroupTitle>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=uWL6FJhq5fM'>BFS and DFS in a Binary Tree</BadgeLink>
<BadgeLink colorScheme='yellow' badgeText='Read' href='https://www.digitalocean.com/community/tutorials/breadth-first-search-depth-first-search-bfs-dfs'>Breadth-First Search (BFS) and Depth-First Search (DFS) for Binary Trees in Java</BadgeLink>
<BadgeLink colorScheme='red' badgeText='Watch' href='https://www.youtube.com/watch?v=Urx87-NMm6c'>Depth First Search in 4 Minutes</BadgeLink>

@ -1 +1,12 @@
# Tree algorithms
# Tree Algorithms
A tree is non-linear and a hierarchical data structure consisting of a collection of nodes such that each node of the tree stores a value and a list of references to other nodes (the “children”).
Here is the list of common tree algorithms:
- Tree Traversal:
- Pre-Order Traversal
- In-Order Traversal
- Post-Order Traversal
- Breadth First Search
- Depth First Search

Loading…
Cancel
Save