Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Guide: Allow 3 0 minutes for this challenge. The procedure By following a special series of instructions ( the procedure ) it is possible to

Guide: Allow 30 minutes for this challenge. The procedure By following a special series of instructions (the procedure) it is possible to find ant value in a list of venues that are sorted in ascending order. This is a useful procedure. In the procedure you will see reference to 5 special keywords: Items, Nemo, Focus, Position and Count. In the procedure each of these keywords actually represent a value, and the value might change during the procedure. You should make a note of the value of each keyword, and update your notes each time these values change. Here is a suggested method for keeping track of the keyword values: Use a table like the one below with a column for each keyword. The procedure changes the value in a keyword by making a statement like "Count is 1". This means you should place "1" in the Count column, in the first row, as in the example below. if the value later changes, write it onto next row in the same column. The current value in the keyword will always be the last entry in that column. Items Nemo Focus Position Count Part 1- Fix the procedure But - I left the paper with the procedure in my pocket when my jeans were washed, and now some details have been erased or smudged. The procedure I now have is listed below, and the parts that cannot read are marked like this: Please fill answers in on these lines. 1. Items is the number of items in the List. 2. Nemo is the Value of an item to be found. 3. Count is 1.4. Focus is 2.5. Position=Item divided by focus, rounded to an integer. 6. Skip to Position in the list 7. If Nemo is equal to the value at Position, then go to line 8. Increase Count by 1.9. If Focus is less than Items, then double the value of Focus. 10. If Nemo is less than the value at Position, then go to line 11. If Nemo is greater than the value at Position, then go to line 12. Position is Position minus (Items divided by Focus, rounded to an integer).13. Go to line 14. Position is Position minus (Items divided by Focus, rounded to an integer).15. Go to line 16. Report "Found (Nemo) in List at [Position) after (Count) attempts". Part 2- Finding Nemo Using the method you created in Part 1: consider the following list of values: 12,15,18,22,24,28,33,35,36,39,43,47,50,59,61,691. How many attempts will it take to find "47" in this list? 2. How many attempts will it take to find "15" in this list? 3. What is the maximum number of attempts to find any value in the list? 4. How many attempts do you need to find any value in a list of: o 60 items? 1,000 items? 1,000,000 items? Scratch patch Items Nemo Focus Position Count Items Nemo Focus Position Count Items Nemo Focus Position Count

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems On GPUs In Databases

Authors: Johns Paul ,Shengliang Lu ,Bingsheng He

1st Edition

1680838482, 978-1680838480

More Books

Students also viewed these Databases questions

Question

What is the primary objective of systems design?

Answered: 1 week ago

Question

7. What does practice at spontaneity and improvisation look like?

Answered: 1 week ago