0% found this document useful (0 votes)
22 views

Data Structure and Algorithim Lab Final Paper

The document contains a final exam for a data structures and algorithms course. It has 4 questions covering topics like hash tables, linked lists, heaps, sorting algorithms, and graph traversal. Students are asked to write code snippets and provide brief explanations for concepts related to these data structures and algorithms.

Uploaded by

Mehreen Arshad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Data Structure and Algorithim Lab Final Paper

The document contains a final exam for a data structures and algorithms course. It has 4 questions covering topics like hash tables, linked lists, heaps, sorting algorithms, and graph traversal. Students are asked to write code snippets and provide brief explanations for concepts related to these data structures and algorithms.

Uploaded by

Mehreen Arshad
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

University of Sialkot, Pakistan

Final Examination- Fall-2020


Course Code: CS – 2230 Course Title: Data Structure and Algorithm Lab
Total Time: 120 Minutes Total Marks: 50 Marks
Department: COMPUTER SCIENCE Program: BScCS(B,G,Y),MScCS
Instructor Name: Waleed Rafique Instructor Sign.:
Student’s Name: Roll No.:

Part 1: Subjective Section


Read the Instructions Carefully
1-60 minutes for paper duration and 60 minutes for PDF and Email.
2-Your answer shall be confined to three to four lines.
3-Save Your PDF File with your Rollno and Section.
Question:1 (10 Marks )

(a) Write C+ Code with Explanation For deletion of an element in Hash table in case of Linear
Probing? How can you Solve Clustering Problem in linear Probing explain in one line?
(b) How can you insert a node at the beginning of Doubly Circular Link List? Write a C+ Code.
Mention one Application of Circular Link List.

Question:2 ( 10 Marks )

(a) Write a C+ program for deletion in a Heap?


(b) Merge and Quick Sorting are the Two Sorting Algorithms. Which is better Sorting Algorithm?
Write function For C+ Code for Quick Sorting Technique? Only write Function Code..

Question: 3 (10 Marks )


a) Write a C+ Code for Radix Sorting in function to do counting sort according to significant digits?
Only Counting Function shall be written?
Question:4 ( 10 Marks )
a) Write a C+ Code For implementation of Queue on Breadth First Search ?
b) Explain the Below Code in three Lines
while(k<n)
{
for(j=n; j>=1; j--)
if(cost[v][j]!=0 && visited[j]!=1 && visit[j]!=1)
{
visit[j]=1;
stk[top]=j;
top++;
}
v=stk[--top];
cout<<v << " ";
k++;
visit[v]=0;
visited[v]=1;
Page 1 of 2
}return 0;

Page 2 of 2

You might also like