Write a pseudocode function to describe an algorithm where the stored data can be searched for a value key: if the data is found, its location in the original array should be returned; -1 should be returned if the data is not found; -2 should be returned if there is a data storage error Include a short commentary explaining why your pseudocode works Describe the worst-case and best-case inputs to your search algorithm Derive the worst-case and best-case running times for the search algorithm Derive the Theta notation for the worst-case and best-case running times

icon
Related questions
Question

DESIGN YOUR OWN SETTING

Task: Devise your own setting for storing and searching the data in an array of non-negative integers redundantly. You may just describe the setting without having to give an explicit algorithm to explain the process by which data is stored. You should explain how hardware failures can be detected in your method. Once you have described the setting, include the following to your answer:

Write a pseudocode function to describe an algorithm where the stored data can be searched for a value key: if the data is found, its location in the original array should be returned; -1 should be returned if the data is not found; -2 should be returned if there is a data storage error

Include a short commentary explaining why your pseudocode works

Describe the worst-case and best-case inputs to your search algorithm

Derive the worst-case and best-case running times for the search algorithm

Derive the Theta notation for the worst-case and best-case running times

IMPORTANT: - please do not use RAID(Redundant Array of Independent Disks) setting and describe the setting you have created thoroughly as i have underlined above. Make sure to include the following points to the answer after describing the setting.

Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer