Question: Hey there chegg, would love some helo with coding in c H 4) [30 points] We said in class (without proving it) that any sorting
Hey there chegg, would love some helo with coding in c
H
4) [30 points] We said in class (without proving it) that any sorting algorithm in comparison model requires at least n log(n) time In this question we will see examples where sorting can be performed in linear time (a) [15 points] Write an algorithm (as pseudo code) that gets an array of length n that contains only numbers 1..100, and sorts it in linear time. Explain your algorithms in words, and explain why the running time is O(n) // Assume that the array has n elements allocated // void sort100 (int* A, int n) and all values are between 1and 100 (b) [15 points] Write an algorithm (as pseudo code) that gets an array of length n that contains all numbers from 0 to n-1, and sorts it in linear time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
