Assigment of Data Structure and Algorithm For BE SE Third Sem 1
Assigment of Data Structure and Algorithm For BE SE Third Sem 1
Assignment #1
Submission deadline: Aug 31, 2020. 12:00 Noon Kathmandu Time
Online Viva (Your main Examination): Sept 2, 2020 (For more info see at TEAMS post)
Instructions:
1. It is a mandatory assignment. But, it is not your EXAMINATION. It carries 5 points
mark for your internal evaluation.
2. If someone who don’t submit this assignment won’t be allowed to take viva.
3. Absent or fail or any inability to appear in viva will make you fail in this course.
4. Students should solve all the question sets provided in this assignment. You can
skip the question if they are repeated and exactly same but you have to specify
there saying the question is repeated. Don't copy from any resource or from your
friends.
5. Clearly specify your Name, Examination roll no, Subject Name in the first page of
your assignment.
6. Marks will be given based on your solutions. Students should do assignment by
own handwriting. If it is needed in future, it will be verified by your handwriting
in your physical presence. If it is failed in verification, it will make you fail in this
course.
7. Students should submit the assignment within the deadline date and time. No
later submissions will be considered and graded.
8. The submission deadline is Aug 31, 2020 by 12:00 noon (Kathmandu time).
9. Make sure that your handwriting is clearly understandable and clearly readable.
10. After you finished your assignment, provide page number (for example 1 of 20) in
each page, scan the copies of your solutions and use this online pdf editor
(https://www.sejda.com/merge-pdf) to merge all the scans copies with proper
sequence based on page numbers in a single pdf file and summit in TEAMS via
Assignments tab and press "Turned In" button in the top right.
11. Don't submit your assignment in post or chat box. The assignments posted in
post and chat box won't be considered and graded.
POKHARA UNIVERSITY
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
Start
2
POKHARA UNIVERSITY
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1. a) What is the difference between data type and data structure? How do 7
you represent Rational number as an ADT?
b) Define stack as an ADT. Enlist any five applications of stack. Convert 8
the given expression into postfix expression showing the content of
stack at each step:
( A + B ) $ (C * D) - E
2. a) Discuss the merits and demerits of contiguous list and linked list. 8
Write algorithms to insert and delete a node in queue implemented in
linked list.
b) “A function or a object calls itself”. Explain this statement using idea 7
behind it. Give recursive algorithms for Fibonacci term and TOH
problem.
3. a) Write down C module to insert an element before, between and after 8
node of singly linked list.
b) What is AVL Tree? Determine the pre order, in order and post order 7
traversal for the following binary tree.
1
4. a) Why sorting is necessary and When radix sort is useful? Trace the 8
following data using radix sort algorithm: 25, 57, 48, 37, 12, 92, 86,
33.
b) Define load factor. Given input { 1, 16, 49, 36, 25, 64, 81, 4, 9, 2 } 7
and a hash function h(x) = x mod 10 show the resulting:
i. Hash table using quadratic probing.
ii. Hash table using chaining.
5. a) Define Big O Notation. What is parallel computing algorithm and 8
When parallel computing algorithm is preferred over the serial one?
b) Find the Minimum Spanning Tree and its weight of the graph using 7
Kruskal’s algorithm:
2
POKHARA UNIVERSITY
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
2
POKHARA UNIVERSITY
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.
1
10
12
6
5 8 11
4 7
9
2
POKHARA UNIVERSITY
Candidates are required to give their answers in their own words as far
as practicable.
The figures in the margin indicate full marks.
Attempt all the questions.