CS301 Final Term Solved Subjective with References Set 3 by Moaaz
- Type
- Final term past paper
- Course
- CS301 Data Structures
- Size
- PDF 471 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 3 of 35. Download the file for all 35 pages.
Studocu is not sponsored or endorsed by any college or university
Cs301 final term subjectives solved with references by moaaz
vustudy
Object Oriented Programming (Virtual University of Pakistan)
Studocu is not sponsored or endorsed by any college or university
Cs301 final term subjectives solved with references by moaaz
vustudy
Object Oriented Programming (Virtual University of Pakistan)
Q1. name of two divide and conquer algorithm (2 marks)
Answer: (Page 488)
- Merge Sort
- Quick Sort
- Heap Sort
These three algorithms fall under ‗divide and conquer category‘.
Q2. difference between call by value n call by reference (2 marks)
Answer: (Page 202) In case of call by value, a copy of object is made and placed at the time of function calling in the activation record. By using the references, we are not making the copy but send the address of the variable that function can use the original value.
Q3. heap and two types of heap(3)
Answer: (Page 333 ) Heap is a data structure of big use and benefit. It is used in priority queue. ―The definition of heap is that it is a complete binary tree that conforms to the heap order‖. Here heap order means the min and max heap. Max heap: In max heap, each node has a value greater than the value of its left and right child nodes. Moreover, the value of the root will be largest and will become lesser at downward levels. Min heap: in a (min) heap for every node X, the key in the parent is smaller than (or equal to) the key in X. This means that the value in the parent node is less than the value on its children nodes.
Q4. height of a tree is 5 find sum of heights (2)
Answer: Height = 5 Nodes = 2^h = 2^5 =32 Sum of Nodes = N-(h+1)= 32-(5+1) = 32-6 = 26
Q5. Here is an array with exactly 15 elements:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15.
examining two or fewer numbers from the array. (Marks: 5)
If there is an array of 15 elements, {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15} it wants to know which elements can be discovered by examining two or fewer elements. I want assume the divide and conquer aspect of a binary search, so that leads me to think these elements will be found 1, 2, 14, 15, 7, 3
rather; 1, 2, 3, 4, 6, 8, 14, 15 1 and 15 for heads and tails 2, and 14 for next elements (following or preceding) 1/2 of 15 is either 6, or 8, from 7.5 and 1/2 of 6 = 3 1/2 8 = 4
Note: - I am not sure about answer; I feel Question logic is not clear.
Q1. Write one example of hashing?
Answer: (page 459) Hashing can be used to store the data. Suppose we have a list of fruits. The names of Fruits are in string. The key is the name of the fruit. We will pass it to the hash Function to get the hash key. HashCode ("apple") = 5 We pass it to the string ―apple‖. Resultantly, it returns a number 5.
Q2. Height of a tree is 5 find sum of heights
Answer: rep
Q3. How do we carry out degeneration of Complete Binary Tree?
Degeneration of the (original) binary tree is mainly reflected by degeneration of the internal infix trees and less
Related CS301 files
All CS301 files →- CS301 Final Term Solved File 6 by Team Hadi Final term PDF 450 KB
- CS301 Final Term Solved MCQs by VU Malik Final term PDF 937 KB
- CS301 Final Term Solved MCQs with References by Moaaz Final term PDF 431 KB
- CS301 Final Term Solved Subjective with References by Moaaz Final term PDF 625 KB
- CS301 Handouts Lectures 1-45 Handout PDF 3.4 MB
- CS301 Current Paper by Adil Alvi Quiz PDF 219 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.