00:01
This question asks us to build a linear search animation, and that means we make a random list of 20 numbers, show them as bars in a histogram, and then search through the list one item at a time when the user clicks step.
00:14
So we're creating a random list of 20 distinct numbers, draw a list as histogram, user enters search key, step equals, we'll check one item, highlight current position, reset will equal a new random list.
00:28
The important idea is that linear search checks elements from left to right, so we need to keep track of the current search position with an index variable.
00:37
So starting at index zero, compare one value at a time, and we need a variable like self -doccurrent.
00:44
At the beginning, the program should generate the list and store the current position is zero, and it should also draw the histogram.
00:51
So next, the interface needs a text field for the key, a step button and a reset button.
01:19
When the user clicks step, the program compares the key to the current list value, then it redraws the histogram and colors that bar to show the search position...