Question: Create 2 D ( 2 - dimensional ) array which has random numbers in the range of between 0 and 2 0 . This array
Create D dimensional array which has random numbers in the range of between and This array must be times matrix. Then, print this D array to the console. After that generate another D array which has random numbers in the range of between and Add first and second randomly generated D arrays with each other. This will be your final D array. Sort each element in each layer rows by increasing order and return the middle elements for each layer. At the final step use Binary Search Algorithm as we discussed in the lab by doing following rules. Convert your D array into the D array. Create D array to hold your converted array. You will do the binary search process in created D array. At the binary search step, you will search the key element based on your school ID Before searching you must do sorting. You can use sort function If your key element is not in your randomly generated array than your code must be print "Element is not found in the array!". If key element is found by binary search algorithm than print the index of your key element. If your last digit of your student ID is even, take key element as your last digit. If your ID: then your key element will be If your last digit of your student ID is odd, take key element as digit before your last digit. If your ID: then your key element will be
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
