subject
Computers and Technology, 19.08.2021 23:00 bae2080

Consider the following algorithm that finds a row where every entry is x in a 2-D array. Assume that (a) the array has n rows and m columns, and that (b) the comparison on line 3 counts towards the running time. 1 FOR every row in the array
2 FOR every column in the array
3 IF [row][column] == 'x' THEN
4 IF column is the last THEN
5 DISPLAY found row
6 ENDIF
7 ELSE
8 move on to the next row
9 ENDIF
10 ENDFOR
11 ENDFOR
1 What is the best case scenario?
2 What is the exact number of operations for the best case scenario in terms of n and m?
3 What is the big-oh for the best case scenario?
4 What is the worst case scenario?
5 What is the exact number of operations for the worst case scenario in terms of n and m?
6 What is the big-oh for the worst case scenario?

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:00, pinkyglitter2696
Give an example of a case where a two-way handshake to establish a connection could leave one side of the connection live while the other side does not believe there is a connection.
Answers: 1
image
Computers and Technology, 22.06.2019 10:30, hope564
Dave has to create animations for a game. which tool can dave use?
Answers: 3
image
Computers and Technology, 22.06.2019 11:30, melissalopez12
Write a function so that the main program below can be replaced by the simpler code that calls function original main program: miles_per_hour = float( minutes_traveled = float( hours_traveled = minutes_traveled / 60.0 miles_traveled = hours_traveled * miles_per_hour print('miles: %f' % miles_traveled) sample output with inputs: 70.0 100.0 miles: 116.666667
Answers: 3
image
Computers and Technology, 23.06.2019 15:00, abelxoconda
1. which of the following statements are true about routers and routing on the internet. choose two answers. a. protocols ensure that a single path between two computers is established before sending packets over it. b. routers are hierarchical and the "root" router is responsible for communicating to sub-routers the best paths for them to route internet traffic. c. a packet traveling between two computers on the internet may be rerouted many times along the way or even lost or "dropped". d. routers act independently and route packets as they see fit.
Answers: 2
You know the right answer?
Consider the following algorithm that finds a row where every entry is x in a 2-D array. Assume that...

Questions in other subjects: