Question: What is the time complexity of this program? System.out.println( Searching data in temp? Enter data: ); int key = in.nextInt(); int loc = search(temp, key);
What is the time complexity of this program? System.out.println(" Searching data in temp? Enter data: "); int key = in.nextInt(); int loc = search(temp, key); if (loc >= 0) { System.out.println("Key found at index " + loc ); } else System.out.println("Key not found" ); O O(log(n)) O 0(1) O(n) O O(n2
Step by Step Solution
There are 3 Steps involved in it
To determine the time complexity of the program we need to know more about the search function ... View full answer
Get step-by-step solutions from verified subject matter experts
