Computer Engineering (Semester 3)
Total marks: 80
Total time: 3 Hours
INSTRUCTIONS
(1) Question 1 is compulsory.
(2) Attempt any three from the remaining questions.
(3) Draw neat diagrams wherever necessary.
1.a. Define and explain the following terms :
(a) Data structure
(b) ADT
(c) Algorithm
(3 marks)
00
1.b. Give pseudo C/ C++ code to concatenate two strings.
(3 marks)
00
1.c. Explain the Greedy strategy with suitable example. Comment
on its time complexity.
(6 marks)
00
Or
2.a. Define and explain the following terms :
(a) Linear data structure
(b) Non-linear data structure
(c) Time complexity
(d) Space complexity
(4 marks)
00
2.b. What is sparse matrix ? Explain with suitable explain.
(2 marks)
00
2.c. Explain the Asymptotic notation Big O, Omega and Theta with
suitable example.
(6 marks)
00
3.a. Write a pseudo C/C++ code to delete intermediate node from
singly linked list.
(3 marks)
00
3.b. Explain Generalized linked list with example.
(3 marks)
00
3.c. What is stack ? Write an ADT for stack.
(6 marks)
00
Or
4.a. What is recursion ? Explain use of stack for recursion.
(4 marks)
00
4.b. Explain the stepwise conversion using stack for the given infix
expression to the postfix expression :
A * (B + C) * D
(2 marks)
00
2.c. Write pseudo C/ C++ code to represent Singly linked list as
an ADT.
(6 marks)
00
5.a. Define the following terms with example :
(a) Dequeue
(b) Priority queue
(c) Linear queue
(6 marks)
00
5.b. Write a pseudo C/C++ code to implement circular queue using
arrays.
(7 marks)
00
Or
6.a. Explain linear queue and circular queue with suitable example.
Give the advantages of circular queue over linear queue.
(6 marks)
00
6.b. Explain priority queue. Give pseudo C/C++ code for array
implementation of priority queue.
(7 marks)
00
7.a. Sort the following numbers using Merge sort.
55, 85, 45, 11, 34, 05, 89, 99, 67
Discuss its time complexity and space complexity.
(6 marks)
00
7.b. Explain sequential search and binary search with appropriate
example and compare their time complexity and space
complexity.
(7 marks)
00
Or
8.a. Explain the algorithm of Quick sort with suitable example.
Discuss its time complexity and space complexity.
(6 marks)
00
8.b. Explain heap sort and sort the given list using heap sort :
18, 13, 12, 22, 15, 24, 10, 16, 19, 14, 30
(7 marks)
00