subject

Consider the following algorithm that determines if two arrays have no elements in common. Assume that (a) the first array has n elements and the second array has m elements and that (b) the comparison on line 3 is the operation that counts towards running time. 1 FOR each element x on the first array
2. FOR each element y on the second array
3 IF x is equal to y then THEN
4. DISPLAY found common element
5 HALT
6 ENDIF
7 ENDFOR
8 ENDFOR
9 DISPLAY no elements in common
Q5.1: What is the best-case scenario?
Q5.2: What is the exact number of operations for the best-case scenario in terms of n and m?
Q5.3: What is the big-oh for the best-case scenario?
Q5.4: What is the worst-case scenario?
Q5.5: What is the exact number of operations for the worst-case scenario in terms of n and m?
Q5.6: What is the big-oh for the worst-case scenario?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
The editing of digital photos us about the same level of difficulty as editing an analog photo
Answers: 2
question
Computers and Technology, 22.06.2019 14:00
Which database model is best used for data warehouse and data mining
Answers: 3
question
Computers and Technology, 22.06.2019 17:50
Farah works in an office with two other employees. all three share a printer and an internet connection. the utility that makes this possible is defragger quicktime soho winzip
Answers: 1
question
Computers and Technology, 22.06.2019 23:00
Is an attack that relies on guessing the isns of tcp packets
Answers: 2
You know the right answer?
Consider the following algorithm that determines if two arrays have no elements in common. Assume th...
Questions
question
History, 03.06.2021 01:00
question
Mathematics, 03.06.2021 01:00
question
English, 03.06.2021 01:00
question
Arts, 03.06.2021 01:00
Questions on the website: 13722360