subject

1. Design an algorithm that reveals some secret integer number from the set {1, 2, .. , n} by guessing random numbers within the given range until the secret number has been guessed. Numbers should be replaced after being guessed such that it is possible to guess 2 and then 2 again, assuming 2 is in the given range. The algorithm should return both the secret number as well as the number of guesses taken. 2. If possible, calculate the tightest Big-O approximation for the average runtime complexity of the algorithm from part (a). If it is not possible, explain why not. Note: assume that choosing a random number takes O(1) time.
3. If possible, calculate the tightest Big-O approximation for the worst case runtime complexity of the algorithm from part (a). If it is not possible, explain why not. Note: assume that choosing a random number takes O(1) time.
4. In a single run, is it possible that of the algorithm from part (a) finds the secret number in fewer guesses than standard binary search algorithm? If so, please provide concrete example of one such situation

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
question
Computers and Technology, 23.06.2019 20:00
What software programs are used to to create professional publication? a.) graphics programs b.) word processors c.) page layout programs d.) spreadsheet programs
Answers: 2
question
Computers and Technology, 25.06.2019 00:40
Roger ginde is developing a program in supply chain management certification for managers. ginde has listed a number of activities that must be completed before a training program of this nature could be conducted. the activities, immediate predecessors, and times appear in the accompanying table: activity immediate predecessor(s) time (days) a -− 44b -− 55 c -− 11 d b 1010 e a, d 55 f c 55 g e, f 1010 calculate the slack time. show the details.
Answers: 2
question
Computers and Technology, 25.06.2019 15:10
Write a program to compute the ideal weight for both males and females in java. according to one study, the ideal weight for a female is 100 pounds plus 5 pounds for each inch in height over 5 feet. for example, the ideal weight for a female who is 5'3" would be 100 + 3*5 = 115 pounds. for a male, the ideal weight is 106 pounds plus 6 pounds for each inch in height over 5 feet. for example, the ideal weight for a male who is 5'3" would be 106 + 3*6 = 124 pounds. your program should ask the user to enter his/her height in feet and inches (both as integers—so a person 5'3" would enter the 5 and the 3). it should then compute and print both the ideal weight for a female and the ideal weight for a male. the general outline of your main function would be as follows: (1) declare your variables (think about what variables you need—you need to input two pieces of information, then you need some variables for your calculations (see the following steps) (2) get the input (height in feet and inches) from the user (3) compute the total number of inches of height (convert feet and inches to total inches (note: 1 foot equal 12 inches and hence 5 feet equal 60 inches. (4) compute the ideal weight for a female and the ideal weight for a male (5) print the answers.
Answers: 2
You know the right answer?
1. Design an algorithm that reveals some secret integer number from the set {1, 2, .. , n} by guessi...
Questions
question
Mathematics, 23.10.2020 19:10
question
History, 23.10.2020 19:10
question
Mathematics, 23.10.2020 19:10
question
Arts, 23.10.2020 19:10
question
Mathematics, 23.10.2020 19:10
question
History, 23.10.2020 19:10
Questions on the website: 13722367