Worksheet 2 1
Worksheet 2 1
1
Student Name: Vishal Singh UID: 21BCA1253
Branch: BCA Section/Group: 21BCA3-A
Semester: 3rd Date of Performance: 08.11.2022
Subject Name: Data Structures Lab Subject Code: 21CAP-214
2. Task to be done:
Write a program to perform quick sort using last element as pivot.
3. Program:
#include <iostream>
using namespace std;
int pvt(int arr[], int l, int r) {
int j, temp, i = l;
int main() {
int size, i, max=0;
int arr[size];
qSort(arr, 0, size);
return 0;
}
4. Observations:
Quick sort has a space complexity of O(log n), making it an excellent choice for
situations when space is limited.
When the pivot element is the largest or smallest, or when all of the components have the
same size. The performance of the quicksort is significantly impacted by these worst-case
scenarios.
5. Output:
6. Learning outcomes (What I have learnt):
1. Learned to implement quick sort using last element as pivot.
Evaluation Grid (To be created as per the SOP and Assessment guidelines by the faculty):
Sr. No. Parameters Marks Obtained Maximum Marks
1. Worksheet 20
2. Quiz 10
3. Class Performance 10