Question: Using Big - O notation, indicate the time requirement of each of the following tasks in the worst case. After arriving at a party, you

Using Big-O notation, indicate the time requirement of each of the following tasks in the worst case.
After arriving at a party, you shake hands with each person there
O(n)
Each person in a room shakes hands with everyone else in the room
O(n****2)
After entering an elevator, you press a button to choose a floor
O(1)
You ride the elevator from the ground floor up to the nth floor
O(n)
Using Big - O notation, indicate the time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!