-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathobservationCA.txt
17 lines (12 loc) · 930 Bytes
/
observationCA.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
1. If we can decide the sequence of functions executed from ‘gprof’.
Ans:
Yes, we can decide the sequence of function of algorithm executed from the gprof by analyzing call graph present in gmon.out file.
The call graph shows how much time was spent in each function and its children. From this information, you can find functions that,
while they themselves may not have used much time, called other functions that did use unusual amounts of time.
by observing the call graph we can understand which function is called for how much amount of time and further it calls which other functions.
2. Comment on the complexity of the algorithm.
Ans:
Time complexity of quicksort :-
Best case :- O(nlogn )<- In best case the pivot would be median element.
Average case :- O(nlogn )<- It is similar to the best case and the elements are unsorted.
Worst case :- O(n^2) <- In the pivot could be end element.