Question: CSCI 1 3 2 Lab 9 : Algorithm Analysis and Big - O Running Time Instructions: For each of the four algorithms below, you will

CSCI 132 Lab 9: Algorithm Analysis and Big-O Running Time
Instructions: For each of the four algorithms below, you will need to find the running time of the algorithm and state the total running time in Big-O notation. For each operation in the algorithm, you will find the running time/time complexity of that operation (just like we did in class). You can print this out and do it by hand or do it in a word/pdf editor. You will not be submitting any code for this lab. This lab is due Thursday October \(31^{\text {st }}\) at 11:59 PM.
Algorithm 1: Given an even-length array, this algorithm splits the input array into two equalsized sub arrays: split_array1 and split_array2.
Example Execution:
Input: [1,2,3,4,5,6,7,8]
Output array \#1: [1,2,3,4]
Output array \#2: [5,6,7,8]
```
public static void split_array(int[] input_array){
int[] split_array1= new int[input_array.length /2];
int[] split_array2= new int[input_array.length /2];
for(int i =0; i input_array.length/2;i++){
split_array1[i]= input_array[i];
}
int counter =0;
for(int j = input_array.length/2; j input_array.length;j++){
split_array2[counter]= input_array[j];
counter++;
}
System.out.println("Output array #1: "+ Arrays.toString(split_array1));
System.out.println("Output array #2: "+ Arrays.toString(split_array2));
}
```
CSCI 1 3 2 Lab 9 : Algorithm Analysis and Big - O

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!