Question: P3) Write a Java code for a method InsertAt (int pos, int num), which inserts given num at A[pos]. Your Answer: public void InsertAt (int
P3) Write a Java code for a method InsertAt (int pos, int num), which inserts given num at A[pos]. Your Answer: public void InsertAt (int pos, int num) For example, if you call InsertAt (5,20) for A = (10,15,24,9,45,67,89), You will get: A = (10,15,24,9,45,20, 67,89), You may assume that A has enough space. } Your Answer: void deleteOne 01 P4) Write a Java method deleteOne which deletes the first element in given array A. For example, if you are given int[] A - {30,10,20,15,25,9) then your code should make A={10,20,15,25,9) 1 10 2 20 3 15 5 9 30 15 20 9 24 P5) What is the time complexity in big Oh for the following Java method? Your Answer: Please provide a brief explanation for the full credit public void F1(int n) { int sum = 0; for (int i=1;i for (int j =1;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
