After reading these pictures, make sure you understand loop, recursion, binary search

Posted Jun 6, 20202 min read

For the data structure, it has always been a shortcoming of most people. It is not easy to learn, but it is easy to forget. Is there a very vivid explanation that we can remember at once? The answer is yes.

The following 10 gif images hope to give you a deeper understanding of looping, recursion, and binary search.

1. Loop

GIF 1:The simplest while loop

GIF 2:Loop with if/else

Second, recursion

GIF 3:direct demonstration of the concept of recursion

GIF 4:Recursive code example

GIF 5:Recursively find the Fibonacci sequence

GIF 6:Recursively find factorial

Confrontation Pen focuses on sharing dry goods such as Java, Python, front-end, field work experience, career development, etc., and pay attention to the excellent programming video tutorials that are compiled by editors; push every day at 14:40 pm, each program A technology platform worth paying attention to.

3. Pass by value and pass by reference

GIF 7:The difference between passing by value and passing by reference

GIF 8:Linear search and binary search for 23 positions

GIF 9:Linear search and binary search find the position of 1

GIF 10:Binary search tree

Confrontation Pen focuses on sharing dry goods such as Java, Python, front-end, field work experience, career development, etc., and pay attention to the excellent programming video tutorials that are compiled by editors; push every day at 14:40 pm, each program A technology platform worth paying attention to.