You are on page 1of 2

SAI RAM ENCINEERINC CULLECE

TAMBARAM WEST, CHENNAI -


DEPARTMENT UF INFURMATIUN TECHNULUCY

UNIT TEST III

Sub. J Code : BS&00Ps in C++ Sub|ect Code :
Year J Sem : II III Brancb J Section : ECE A,B&C
Date J Session : Time Duration : Bis


Part - A (Answer ALL Questions) ( 5 x 2 10)

1. What are two complexity analysis? Explain them.
2. What are templates? Give the general Iormat oI class template.
3. What is a virtual base class?
4. What is virtual Iunction?
5. List out the methods in which the Iiles can be opened.
6. DeIine space complexity and time complexity.
7. DeIine Greedy, Dynamic programming and Divide and conquer Algorithms.
8. What is indexed sequential search?
9. What is the worst case and best case time complexity oI binary tree sort?
10.What is meant by adjacency matrix?

PART - B ( Answer any 3 questions ) ( 3 x10 30)
1. a. i. Write a short note on analysis oI algorithm. Discuss the various notations and their
complexities. (5)

ii. DeIine NP, NP-Complete Problems and NP-hardness. (5)

(or)

b. what is topological sort?write the pseudocode to perIorm topological sort and apply the
same to the Iollowing graph (10)

2. a. Write a C program to deIine a class called patient` (name, age, sex). Derive two classes
Irom patient` namely in-patient` (ipno, date-oI-adm, date-oI-discharge) and out-patient`(opno
,doctor-id, consultation-Iee. DeIine two classes namely general-ward`(rent / day) and special-
ward`(roomno, rent/day, eb-bill). For out-patient print the bill with consultation-Iee. For in-
patients, print bill According to their accommodation either in general-ward or special-ward.
(10)
(or)

b. Explain Dijikstra`s Algorithm and solve the single source shortest path problem. Assume
as the source vertex. (10)

3. a. What is a Iile mode? Describe the various Iile mode options available with proper examples.
(10)
(or)

b. Explain the algorithm oI Quicksort by sorting the Iollowing set oI numbers
as an example: 42 47 52 57 62 37 32 27 22 (10)
4. a. Compare and contrast Insertion-sort and Shell-sort. (10)
or

b. What is an exception? How is an exception handled in C? (10)

5 a . Explain the various Iorms oI inheritance in C with necessary coding. (10)

or

b. DeIine a class string`. Use overload ` operator to compare two strings (10)

You might also like