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); if
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(log(n)) 0(1) O O(n) O O(n2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
