DAA Lab - Practical No. 01 - AI&DS
DAA Lab - Practical No. 01 - AI&DS
DAA Lab - Practical No. 01 - AI&DS
Practical No. 01
Aim: Write and implement the menu-driven program for quick sort and merge sort.
Name of Student:
Roll No.:
Semester/Year: V Semester / III Year
Academic Session: 2024 – 2025 (ODD)
Date of Performance: ___ / ___ / 2024
Date of Submission: ___ / ___ / 2024
Design & Analysis of Algorithm (PCCAD502P)
PRACTICAL NO. 01
AIM: Write and implement the menu-driven program for quick sort and merge sort.
OBJECTIVE
THEORY:
Quick Sort:
Merge sort is
defined as a
sorting algorithm
that works by
dividing an array
into smaller
subarrays, sorting
each subarray,
and then merging
the sorted
subarrays back
together to form
the final sorted
array. Quick sort (sometimes called partition-exchange sort) is an efficient sorting algorithm,
serving as a systematic method for placing the elements of an array in order. Quick sort is a
comparison sort, meaning that it can sort items of any type for which a "less-than" relation
(formally, a total order) is defined. In efficient implementations it is not a stable sort,
meaning that the relative order of equal sort items is not preserved. Quick sort can operate
in-place on an array, requiring small additional amounts of memory to perform the sorting.
Merge Sort:
Merge sort is a sorting
technique based on
divide and conquer
technique. Merge sort
is defined as a sorting
algorithm that works
by dividing an array
into smaller subarrays,
sorting each subarray,
and then merging the
sorted subarrays back
together to form the
final sorted array. With
worst-case time complexity being Ο (n log n), it is one of the most respected algorithms.
Merge sort first divides the array into equal halves and then combines them in a sorted
manner.
CODE:
CONCLUSION: