08-20-2016, 06:24 PM

By Ubuntu

Today's paper

mostly mcqs in moaaz fileeee

avl tree sy kafe queston ay thyyyy

what is hashing .... 2m

how we can apply unioun operation on element initially difference sts...2m

describe the case in wich expression tru does not work binary tree......2m

draw AVL treee..... 5m

By Chaudhry

CS301 Exam held today:

How one can find the height of a binary tree? (2 marks)

Name any two of "divide and conquer" algorithms. (2 marks)

Why do we use Huffman encoding? (2 marks)

How does heap sort work? (2 marks)

Explain the working of Heap sort. (3 marks)

A function defined with const was given. Output was required. (3 marks)

Insertion sort is used for small lists and quick sort is used for large lists. Why? (3 marks)

Heap tree was given to find either it's Max or Min. The tree data was required to write as an array as well. (3 marks)

Define Collision, Linear Probing, Quadratic Probing. (5 marks)

Data was given to make an AVL Tree. (5 marks)

Sets were given to make Union Tree using weight rule. (5 marks)

Expression tree was given to write Infix expression with parenthesis. (5 marks)

today cs301 paper

Q.No.1.marks 2.

How many rotations will be required to delete a node in AVL tree. If the delete node balance 0 and the node was deleted in the parents.

1) Left sub tree

2) Right sub tree

Q.No.2.marks.2

How we can use Disjoint sets for image segmentations.

Q.No.3.marks.2

Give the names of two Divide and Conquer algorithm.

Q.No.4.marks.2

What is the first step of Huffman encoding algorithm.

Q.No.5.marks.3

Create frequency table from “Huffman Encoding”.

Q.No.6.marks.3

Suppose the following function is define in a class named “A”

Intf(inty)const

{

Cout<<y<<endl;

Intx;

X=y+10;

Cout<<x;

}

What is the output of the function when 20 is passed to y???

Q.No.7.marks.3

Construct the tree using union field data structure. Relations are given bellow:

Union(O,A),union(B,M),union(A,G),union(O,N),union(J,H),union(A,C),union(O,B)union(J,O)

Q.No.8.marks.3

Here is an array of integers

5 3 8 9 1 7 0 2 6 0

Draw this after the first iteration of insertion sort(sorting from smallest to largest)

Q.No.9.marks.5

Show the result of inserting

2,1,4,5,9,3,6

Into an empty AVL Tree. You have to show only the AVL complete tree, steps are not required.

Q.No.10.marks5

Apply insertion sort algorithm on the following numbers show all steps

77,33,11,88,22,66,55

Q.no.11.5

Suppose we have following representation for a complete binary search tree

A B C D E F G H I J K L M N O P Q R S T ………..

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ..........

What would be the

a) Left child

b) Right child

c) Parents

d) Of the nodes H and I.

Q.No.12.marks.5

Here is an array with exactly 15 elements

1,2,3,4,5,6,7,8,9,10.11.12.13.14.15

Suppose we want to find an element using binary search, Indicated that which elements will be found in first two iteration for the following cases

Case 1.The number to be found is 1.

Case 2. The number to be found is 15.

Today's paper

mostly mcqs in moaaz fileeee

avl tree sy kafe queston ay thyyyy

what is hashing .... 2m

how we can apply unioun operation on element initially difference sts...2m

describe the case in wich expression tru does not work binary tree......2m

draw AVL treee..... 5m

By Chaudhry

CS301 Exam held today:

How one can find the height of a binary tree? (2 marks)

Name any two of "divide and conquer" algorithms. (2 marks)

Why do we use Huffman encoding? (2 marks)

How does heap sort work? (2 marks)

Explain the working of Heap sort. (3 marks)

A function defined with const was given. Output was required. (3 marks)

Insertion sort is used for small lists and quick sort is used for large lists. Why? (3 marks)

Heap tree was given to find either it's Max or Min. The tree data was required to write as an array as well. (3 marks)

Define Collision, Linear Probing, Quadratic Probing. (5 marks)

Data was given to make an AVL Tree. (5 marks)

Sets were given to make Union Tree using weight rule. (5 marks)

Expression tree was given to write Infix expression with parenthesis. (5 marks)

today cs301 paper

Q.No.1.marks 2.

How many rotations will be required to delete a node in AVL tree. If the delete node balance 0 and the node was deleted in the parents.

1) Left sub tree

2) Right sub tree

Q.No.2.marks.2

How we can use Disjoint sets for image segmentations.

Q.No.3.marks.2

Give the names of two Divide and Conquer algorithm.

Q.No.4.marks.2

What is the first step of Huffman encoding algorithm.

Q.No.5.marks.3

Create frequency table from “Huffman Encoding”.

Q.No.6.marks.3

Suppose the following function is define in a class named “A”

Intf(inty)const

{

Cout<<y<<endl;

Intx;

X=y+10;

Cout<<x;

}

What is the output of the function when 20 is passed to y???

Q.No.7.marks.3

Construct the tree using union field data structure. Relations are given bellow:

Union(O,A),union(B,M),union(A,G),union(O,N),union(J,H),union(A,C),union(O,B)union(J,O)

Q.No.8.marks.3

Here is an array of integers

5 3 8 9 1 7 0 2 6 0

Draw this after the first iteration of insertion sort(sorting from smallest to largest)

Q.No.9.marks.5

Show the result of inserting

2,1,4,5,9,3,6

Into an empty AVL Tree. You have to show only the AVL complete tree, steps are not required.

Q.No.10.marks5

Apply insertion sort algorithm on the following numbers show all steps

77,33,11,88,22,66,55

Q.no.11.5

Suppose we have following representation for a complete binary search tree

A B C D E F G H I J K L M N O P Q R S T ………..

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ..........

What would be the

a) Left child

b) Right child

c) Parents

d) Of the nodes H and I.

Q.No.12.marks.5

Here is an array with exactly 15 elements

1,2,3,4,5,6,7,8,9,10.11.12.13.14.15

Suppose we want to find an element using binary search, Indicated that which elements will be found in first two iteration for the following cases

Case 1.The number to be found is 1.

Case 2. The number to be found is 15.