Skip to content

Jump search

finding

Level 2 of 3

Also called Block search.

fresh numbers

The test's questions that a run answers, asked again on new numbers whenever you like. The answer, its working and the reason for every other choice come from jump search's own run on the numbers shown.

choose one

question 1

How many looks does jump search take to find 52 in 3, 9, 15, 22, 30, 37, 44, 52, 61, 68, 77, 85?

3915223037445261687785
the answer, and why

the answer is A

Blocks of 3. The ends 15 and 37 are smaller, 61 is not, so the walk starts at place 7. 44, then 52. 5 looks.

  • Looking for 52: 5 looks, found at place 8.

    319215312243053762447452856193681077118512block 1block 2block 3block 4
  • a look, numbered in turn
  • found, ringed
  • looked at, not it
  • ruled out without a look
  • never reached
  • a block passed whole
  • the block looked through
  • a block never reached
Three block ends, then two places of block 3.

if you chose another

  • 52 stands at place 8. That is linear search's count, one look a place.
  • That counts the block ends alone. The walk adds 2.
  • The walk stops at 52, before it reaches 61 again.

new numbers

question 2

Jump search looks for 38 in 6, 21, 38, 38, 48, 57, 73. At which place does it stop?

6213838485773
the answer, and why

the answer is C

Blocks of 2. Block 1's end, 21, is smaller. Block 2's end, at place 4, is 38, not smaller, so the walk starts at place 3 and finds the first 38 there.

  • Looking for 38: 3 looks, found at place 3.

    61212138333842485576737block 1block 2block 3block 4
  • a look, numbered in turn
  • found, ringed
  • looked at, not it
  • ruled out without a look
  • never reached
  • a block passed whole
  • the block looked through
  • a block never reached
The walk starts at the block's first place, so it stops at the first 38.

if you chose another

  • Place 4 is where 38 is first seen, as block 2's end. The walk then starts at place 3.
  • Place 2 holds 21, smaller, so its block is passed.
  • The search never gets to place 7.

new numbers

question 3

Which search costs jump search the most looks? Each option is a row, then, after the semicolon, the number wanted.

the answer, and why

the answer is A

68 is the last of the last whole block. 3 block ends, then 3 places, 6 looks.

  • Looking for 75: 5 looks, found at place 10.

    41112193126434543625176086893751045block 1block 2block 3block 4
  • Looking for 68: 6 looks, found at place 9.

    411121931264345436251746085689367510block 1block 2block 3block 4
  • Looking for 80: 4 looks, not there.

    4111219312643454362517608689375104block 1block 2block 3block 4
  • Looking for 4: 2 looks, found at place 1.

    41211219312643454365176086897510block 1block 2block 3block 4
  • a look, numbered in turn
  • found, ringed
  • looked at, not it
  • ruled out without a look
  • never reached
  • a block passed whole
  • the block looked through
  • a block never reached
The four options in order, a to d. Only b looks through a whole block of 3.

if you chose another

  • 75 stands last, but its block holds 1 number. 4 ends and 1 place, 5 looks.
  • 80 is bigger than every block's end, so there is no walk. 4 looks.
  • 4 stands first. 2 looks, the fewest.

new numbers