CS502 ASSIGNMENT SOLUTION NO.2 SPRING2020
Objective
The objective of this assignment
is
·
To give basic knowledge and
understanding of Algorithms.
·
To be able to design
sorting algorithms.
·
To be able to understand and
calculate the complexity of algorithms.
Note:
Your answer must follow the
below given specifications.
·
Font style: “Times
New Roman”
·
Font color: “Black”
·
Font size: “12”
·
Bold for heading only.
·
Font in Italic is not allowed at all.
·
No formatting or bullets are allowed to use.
·
Your answer should be
precise and to the point, avoid irrelevant detail.
Lectures Covered: This assignment covers Lecture # 08 - 14
Deadline
Your assignment must be
uploaded/submitted at or before: 06/16/2020.
Consider the
given array having unsorted elements, and answer the two questions asked
below.
Question no 01: (10: Marks)
Apply quick sort
algorithm on below given array by taking value (30) as pivot element and write
down the resulted arrays till first pass only.
30 |
48 |
10 |
20 |
70 |
15 |
80 |
40 |
∞ |
Question no 02: (10: Marks)
Write down the
recurrence relation of quick sort in case of average or normal case means when
the pivot’s element location is the middle of array.
CS502 handouts
CS502 assignment 2 solution 2020
Assignment prepared by: vu ahmed
0 Comments