Home

BS 3/4 Semester/Term 2024

BS 3/4 Semester/Term 2024 — page 1

Discussion

Ask a question about this paper, or help someone else with theirs. Answers are emailed to whoever asked.

Your email is only used to send you replies and occasional Ustadni updates. It is never shown publicly.

Log in to post under your name

No questions yet — be the first to ask.

Paper text

University of Sargodha

Subiest: CS/SE

BS 3'4 Term Examination 2024

Paper: Data Structure & Algorithm (CMPC-201)

Time Allowed: $2:30 Hours

Maximum Marks: 40

Note: Objective part is compalery. Mimpt any thre questions from subjective part.

Q.1.

Objective Part

(Compulsory)

Write short answers of the following in 2-3 lines of each on your noswer sheet

Write a funetion to sort integers using selection sort algorithms.

What is a binary search tree?

I Explain the difference between an aray and a linkod lis

What is Kruskal's algorithm?

- Discuss the Doubly Linked Tise.

Differentiate between lincur sod noedincir data structufor with examples.

What is the difference between linear and binary search?

What is the difference between stack and queue?

(2*8)

brine rar

(3*5)

0.2. Was are the properties of an AVL. tree? Coastrt an AVL. tree using the following sequence of

data: 12,

23. 5,7.32,50,72, 58,65.

Q.3. Describe the Quick Sort algorian's step-by-step proces. Give full details of how quick sort selects

a pivot element Also, sort the following elements using this alporithms.

19 54 40 12 24 89 41

Q.4.

a) Explain the depeb-fist search (DFS) algorthe for traversing graphs. Explain step by step how

DES explores a grapb's vertices?

b) Discuss the analysis of the algoritin in the contest of time complexity. Co

Q.5.

Q.6.

Briefly explain the adjacency list and adjacency matrix representation of the graph with

a) Define abstract data type (ADT). Discuss the PUSH and POP operations on the stack.

b) Use Stack to convert the following infix expressions:

X * (Y- Z) / A + B * (A - By(C+D) to prefix expression

ustadni.com