Coventry University Logo
4061CEM - Programming and Algorithms 1
  • Searching Algorithms
    1

Searching Algorithms

Before you attempt this activity, it is best that you review lecture video one from week eleven. You can find the video and slides on the module page.

For this activity you will be using the integrated development environment recommended by the module leader. If you need to set up your development environment, it is recommended that you check out the instructions from activity four of week one.

Are You Struggling?

If you have trouble with any of the tasks or want to check your answers are correct, then please make yourself known to a member of staff.

Task 1

For this task you need to write a function implementing the Jump Search algorithm that will search for a given number. For a given list, for example:

[0, 1, 2, 5, 7, 9]

From this list you will need to find the value \(2\) and return the index number of its location.

If you require further assistance with this algorithm, then you may want to read up on Jump Search.

Hint

You will want to ensure that the index number that is returned from the algorithm is an integer number.