DSA-Mid-spring-2020-14052020-114334pm.pdf - Bahria University Total Pages 05 Lahore Campus Mid Term Assessment(Spring-2020 Semester Department of

# DSA-Mid-spring-2020-14052020-114334pm.pdf - Bahria...

This preview shows page 1 - 2 out of 5 pages.

Bahria University Lahore Campus Mid Term Assessment (Spring-2020 Semester) Department of Computer Sciences Solution Uploaded on LMS Date & Time: 1 st June 2020 Due Date: 31 May 2020 Instructor Name: Nadeem Sarwar Program/Semester: BS(CS) 3(A/B) Course Title: Data Structure & Algorithm Course Code: CSC-221 Max Marks: 100 Weightage: 20% Instructions: Read out the Instructions carefully. I. Properly mention roll number, name and class with section on page header. II. Attempt all questions and clearly mention question number before solution III. Solve all questions on page and create pdf file with proper page number. IV. Use your own words to explain answer step by step. __________________________________________________________________________________________ Subjective: No. Detail of course learning outcomes Question No. CLO1 C1 To understand the design of fundamental data structures as well as algorithms that operate on them QNo.1 CLO2 C2 Students will become aware of how data structures are used in real-world applications QNo.1(part A) CLO3 C3 To understand the fundamental tradeoffs in the design of the data structures QNo.2 & 3 CLO4 C4 To solve various problems regarding linear data structures QNo.4 & 5 PART-A Question No 1. Step by step answer the following questions in your own words, [50Marks] 1. Predict the output of following program int f(int n){ if(n <= 1) return 1; if(n%2 == 0) return f(n/2); return f(n/2) + f(n/2+1); } void main(){ cout<< f(11); } 2. Consider the following function that takes reference to head of a Doubly Linked List as parameter. Assume that a node of doubly linked list has previous pointer as prev and next pointer as next .

#### You've reached the end of your free preview.

Want to read all 5 pages?

• Spring '20
• Array data structure

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern