IDEA is a series of graphic algorithms developed by SandorP. Fekete, Sebastian Morr, and Sebastian Stiller. They were originally designed for Sandor’s lectures on algorithms and data structures at the Technical University of Brunswick in Germany, and the author wanted them to be more widely used, so he posted the project online to help teachers, students and curious people. The algorithm will be updated over time and you can visit the idea-instructions.com/ page for more information.

These images are drawn using Inkscape and can be edited using any vector editing software. Each algorithm has the corresponding image download address below.

Quick sort

Quicksort is a divide-and-conquer sorting algorithm that randomly selects “partition points” to avoid worst-case scenarios.

  • Select partition point at random.
  • Draw a line according to the height of the partition point.
  • Elements above the branch point need to move to the right.
  • Elements below the “partition point” need to move to the left.
  • Move elements.
  • Repeat the above steps to sort the elements on either side of the partition point.

Download it at idea-instructions.com/quick-sort/

Bogo sorting

Bogo sort, also known as “stupid sort”, is a very simple but inefficient sorting algorithm that constantly scrambles the order of elements until it reaches an order.

  • Check that the elements are in order.
  • Elements are out of order, so out of order.
  • Check again that the elements are in order.
  • If the order is in order, the order is successful, otherwise continue to repeat the above steps.

Download it at idea-instructions.com/bogo-sort/

Binary search

Binary lookup is a lookup algorithm that quickly finds the location of an element in an ordered array. It’s a bit like a number guessing game, where you can guess a target number by constantly asking questions like “Is the target number greater than or less than a certain number?”

  • Limits the range of elements.
  • Is the element to be found somewhere in the interval?
  • Not here.
  • See if the search element is to the left or right of the current position.

Download: idea-instructions.com/binary-sear…

Merge sort

Merge sort is also a divide-and-conquer recursive sorting algorithm.

  • Divide an element into two parts and apply recursive merge sort to each part.
  • Compare the sorted elements.
  • Merges sorted elements.
  • Sorted.

Download it at idea-instructions.com/merge-sort/

Balanced binary trees

Balanced binary tree is a variety of self-balanced binary tree, which can guarantee fast search, insert and delete operations.

Take the balanced binary tree in the figure as an example:

  • The left child is smaller than the parent, which is smaller than the right child. If the height difference between the left and right subtrees of the root node is more than 1, it becomes unbalanced.
  • Want to know if the tree contains element 11? 11 is greater than 10, so look for 10’s right child, 12. 11 is less than 12, so we look for the left child of 12, and the left child of 12 happens to be the 11 we’re looking for. Similarly, does the tree contain element 8? 8 is less than 10, so look for the left child of 10, 6. 8 is greater than 6, so look for the right child of 6. If the right child of 6 does not exist, element 8 does not exist in the tree.
  • How do I find the smallest element in the tree? You start at the root, you go all the way to the left child, and you find the last leaf which is the smallest element in the tree.
  • How do you find the next element of 10? If the root node happens to be 10, find the smallest element in the right subtree of 10. If the root node is not 10, find 10 first. If 10 has no right child, go to the parent node until you find something larger than 10.
  • Adding 17 or removing 10 to a tree disrupts the balance of the tree, which needs to be restored by rotation.

Download it at idea-instructions.com/avl-tree/

Graph traversal

Graph traversal algorithms traverse all reachable vertices in the graph, and various traversals can be achieved through auxiliary data structures, such as random traversal using unordered sets, depth-first traversal using stacks, and breadth-first traversal using queues.

  • Random search: Select a vertex and place it in an unordered set. Takes a vertex from the set, accesses the vertex, puts the vertex’s neighboring vertices into the set, and moves the vertex out of the set. Repeat this process until all the elements in the collection are iterated.
  • Depth-first traversal: select a vertex and push one of its neighboring vertices onto the stack. Accesses the vertex at the top of the stack and exits the stack if there are no other neighboring vertices. If there are other neighboring vertices, one of them is pushed onto the stack. Repeat this process until all the elements in the stack are iterated.
  • Breadth-first traversal: Select a vertex and place adjacent vertices at the end of the queue. Access the vertex at the head of the queue, remove that vertex from the queue, and put adjacent vertices at the end of the queue if that vertex has adjacent vertices. Repeat this process until all the elements in the queue have been traversed.

Download it at idea-instructions.com/graph-scan/

A stroke

A stroke is a Fleury algorithm designed to elegantly find Eulerian paths in graphs. A Euler path is a path in a graph that passes just over each edge, and each edge is visited only once.

  • The vertex degree indicates how many edges the vertex has.
  • Euler paths exist if there are only two vertices in the graph with odd degree and the others with even degree, or if there are no vertices with odd degree.
  • Select a vertex and start drawing a path.
  • If there are more than two Bridges, you can take the bridge. If there’s only one bridge left, you can’t take the bridge, unless there’s only one bridge left to take.
  • If there are any edges that have not been crossed, repeat Step 4.
  • Euler path was drawn successfully.

Download it at idea-instructions.com/euler-path/

In addition, I have an Android learning PDF+ architecture video + interview documents + source notes to share, if you have the need, you can pay attention to the wechat public number [Android development home] for free