0% found this document useful (0 votes)
8 views134 pages

CS301 Quiz 1

The document contains a series of questions and answers related to data structures, algorithms, and programming concepts. It covers various topics including function calls, binary trees, AVL trees, hash tables, and expression evaluations. The content is structured in a quiz format, providing correct answers and explanations for each question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views134 pages

CS301 Quiz 1

The document contains a series of questions and answers related to data structures, algorithms, and programming concepts. It covers various topics including function calls, binary trees, AVL trees, hash tables, and expression evaluations. The content is structured in a quiz format, providing correct answers and explanations for each question.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 134

Which of the following calling method does not

change the original value of variable passed to a

function as an argument?

Call by passing as value

What is the maximum of recursive calls a function

may make?

n (where n is the argument)

Here is a small function definition:

void f(int i, int &k)

i = 1;

k = 2;

Suppose that a main program has two integer variables x

and y, which are given the value 0. Then the main program

calls f(x,y); What are the values of x and y after the function f

finishes?
x is still 0, but y is now 2.

Write in postfix form 5 * (9 - 7)

597-*

Which of the following is NOT true regarding the maze

generation?

Remove a randomly chosen wall if the cells it separates are

already in the same set

An array x of 100 integers is declared as

int x[100];

Local variables defined inside function body are ________

automatically at the end of function execution.

Created

Which of the following statement is NOT correct regarding

Table ADT?

A table consists of deveral columns known as entities


In doubly linked list there is/are _______ pointer/s in each

node.

Two

"new int[11]" will allocate memory for ________ integers.

11

If a tree has 20 edges/links, then the total number of nodes in

the tree will be:

21

In the statement int& a=b;

b hold the address of variable a

Which of the following is NOT an open addressing technique to

resolve collisions?

Double hashing

Consider the function X as under

int X (int& Value)


{

return Value;

Now a and b are integers in a calling function. Which one of the

following is a valid call to the above function X?

a = X(*b);

For a perfect binary tree of height 4, What will be the sum of

hights of nodes?

26

If unions are done by weight (size), the depth of any element is

never greater than

log2 n

Which of the following statement is NOT true for reference

variable?

References can be uninitialized.

The tree data structure is a


Non-linear data structure

In singly linked list a node consists of two parts:

Object and pointer

The simplest case in a BST to delete a node is:

When the node, that is to be deleted is a leaf node

A binary tree with 24 internal nodes has ________ external

nodes.

25

a * (b+c)-d is an example of ________ expression.

infix

given the values are the array representation of heap:

12 23 26 31 34 44 56 64 78 100

If we perform 4 deleteMin operations, the last element deleted

is ________.

31
In ________, a programmer uses two pointers in the node, i.e.

one to point to next node and the other to point to the previous

node.

Linked list

Trying to remove an element from an empty stack is called

________ .

Underflow of stack

For reference variables, ________ sign is used.

ampersand

Which property of equivalence relation is satisfied if we say:

Ahmad R(is related to) Ahmad

Reflexivity

Suppose there is an image segmented into pixels. Each pixel

has ________ neighbour(s).

8
The most difficult case for deleting a node from Binary Search

Tree is when the node to be deleted ________.

is Leaf node

When an executable program runs, it is loaded in the computer

memory and becomes a ________ .

Process

If class A defines class B as its friend, then:

Class B can access private members of Class A

In the poat-order traversal of a binary search tree, nodes

process as:

Left-subtree, Right-subtree, Root

The expression AB+C* is called?

Postfix expression

Binary Search can be categorized into which of following?

Divide and conquer


The main use of AVL tree is:

Storing of data

Select the one FALSE statement about binary trees:

Every binary tree has at least one node.

A table consists of several columns, known as

Fields

Each operator in a postfix expression refers to the previous

________ operand(s).

One

If there are 56 internal nodes in a binary tree then how many

external nodes this binary tree will have?

57

Which of the following function don't belong to the stack class?

crash()
Which of the following statement is false?

Arrays are dense lists and static data structure

During union by size method, which data structure is used to

improve the balancing of tree?

Array

Non-recursive calls are faster than which of the following calls?

Recursive

Binary Search Tree voilates the condition of AVL tree when any

node has balance equal to

Each node in Binary Search Tree has

2 pointers

What will be postfix expression of the following infix

expression?

Infix Expression: a+b*c-d


abc*+d-

The balance of a node is the result of "height of left subtree"

________ "height of right subtree".

Minus

A complete binary tree having "N" nodes consists of ________

Levels.

Log2 (N+1) -1

Consider a hash table of size seven, with starting index zero,

and a hash function (3x + 4)mod7. Assuming the hash table is

initially empty, which of the following is the contents of table

when the sequence 1, 3, 8, 10 is inserted into the table using

closed hashing? NOte that '_' denotes an empty location in the

table.

1, 8, 10, _, _, _, 3

Which one of the following is known as "Last-In, First-Out" or

LIFO Data Structure?


Stack

Parameters in function call are passed using,

Stack

If we singly linked list to implement list, then there is an issue

that it gives difficulty when we:

Move backward in the list

Which of the following is correct about AVL Tree?

It is identical to BST except height of the left and right subtrees

can differ by at most 1.

Insertion in a linked list can be done at

Front, Back and somewhere in the middle

If the height of a perfect binary tree is 4. What will be the total

number of nodes in it?

31

AVL tree is linear data structure.


TRUE

During the union by size method, all the array element

initialized to -1 shows:

Initial condition of tree

Consider the following pseudo code

declare a stack of characters

while ( there are more characters in the word to read )

read a character

push the character on the stack

while ( the stack is not empty )

pop a character off the stack

write the character to the screen

What is written to the screen for the input "apples"?


selppa

Consider the linked list having data [6, 72, 35, 65, 25] stored in

it. While current pointer is pointing to memory location having

72 stored in it. After calling add(4) function on the following

linked list current point will point to memory location having

value?

One difference between a queue and a stack is

Queues use two ends of the structure, stacks use only one.

next() method of List class is used to:

Moves the current position forward one element

get(?) method of list class is used to:

Get element at the given position


If we want to find median of 50 elements, then after applying

buildHeap methd, how many times deleteMin method will be

called?

25

In simple or singly linked list there is/are ________ pointer/s in

each node.

One

If we have 1000 sets each containing a single different person.

Which of the following relation will be true on each set:

Reflexive

The total number of nodes on 10th level of a perfect binary tree

are :

1024

If there are 100 elements in a heap, and 100 deleteMin

operation are performed, will get ________ list.


Sorted

In simple implementation of stack, isFull() method is used due

to ________.

Limitation of array

If a tree has 50 nodes, then the total edges/links in the tree will

be:

49

Following is a keyword of C++ ________ .

Delete

In level-order traversal for Binary Search Tree, at each level,

we visit the nodes in ________ order.

Left-to-right

To search an element in ALV tree, it takes maximum 1.88

Log2n time.

FALSE
If we want to find 3rd minimum element from an array of

elements, then after applying buildHeap method, how many

times deleteMin method will be called?

If there are N elements in an array then the number of

maximum steps needed to find an element using Binary Search

is ___________.

log2N

The ________ method of list data structure removes the

element residing at the current position

Remove

Allocating and de-allocating memory for linked list nodes take

________ time than pre-allocated array.

More

In a tree, we link the nodes in such a way that it ________ a

linear structure.
Forms

Longest path from root node to farthest leaf node is called

________ of tree.

Depth

In which of the following function signatures, the value of

variable "num" cannot be changed in function body?

int cube(int num)

Binary search algorithem cannot be applied to ________ .

sortrd linked list

The expression

if (! heap ->isFull() )

check

Heap is not full

Which of the following is correct statement?


An AVL tree is identical to BST expect height of the left and

right subtree can differ by at most 1.

The easiest case of deleting a node from BST is the case in

which the node to be deleted _________.

Is a leaf node

Every AVL is ___________.

Binary Search Tree

________ is when function is calling to itself.

Recursion

For a perfect binary tree of height h, having N nodes, the sum

of hights of nodes ia ________.

N-h-1

The binary tree is the maximum level of its leaves (also called

the depth).

Height
Which one of the following is NOT true regarding the skip list?

List Sh contains only the n special keys

Suppose we have been given the following data set for a

Queue.

7524

What will be the resultant Queue if we call enqueue(3) method?

Note that 7 is the front element whereas 4 is rear element of

queue.

75243

If there are N external nodes in a binary tree then what will be

the no. of internal nodes in this binary tree?

N -1

int htdiff = height(root->getLeft()) ________ height(root-

>getRight());

The above line of code is taken from AVL insert method.

Complete it by selecting an appropriate symbol.


-

Which of the following can be used to reverse a string value?

Stack

The next field in the last node of a singly-linked list is set to

________.

'NULL

If there are N internal nodes in a binary tree then what will be

the no. of external nodes in this binary tree?

N +1

A hash function returns a ________ value.

Integer

The union operation is based on size or weight but the reducing

the in-between links or path compression from ________ to the

________ is done by the find method.

nodes, root
If there are 23 external nodes in a binary tree then what will be

the no. of internal nodes in this binary tree?

22

________ in AVL is logarithmic.

Searching

In case of insertion of right inner node in BST,

we need to apply single left rotation to make it AVL tree.

Consider the following infix expression.

7/8 + 9

If one converts the above expression into postfix. What would

be the resultant expression?

789/+

What are the basic things associated with data structures?

All of the given


Which of the following properties are satisfied by Equivalence

relationship?

Reflexive, Symmetric and Transitive

For compiler, a postfix expression is easier to evaluate than

infix expression?

True

The expression DE+H* is called ________.

Hybrid expression

Consider the following expression:

x-y*a+b/c

Which of the following is a correct equivalent expression for the

above?

xya*-bc/+

In the call by ________ methodology, a copy of the object is

passed to the called function.


Value

There are four cases of rotation is an ________ tree.

AVL

In singly linked list which node will keep track of starting

position of the list.

Next Node

The depth of a binary tree is

Maximum level of a leaf

What will be the value of root of an AVL and BST if built from

the same data?

Root of AVL is square of root of BST

In 1990, Bill pugh proposed an enhancement on linked lists and

the new data structure was termed as

Skip list

Avl tree takes maximum ________ time to search an element.


1.44 Log2n

Can we store elements with different data types in a single

array?

Yes

The ________ of a node in a binary tree is defined as the

height of its left subtree minus height of its right subtree.

Balance

What is the depth of any tree if the union operation is

performed by height?

O(log N)

If a hash function returns 4 for more than one value, this

condition is called ________.

Collision

Which one of the following calling methods does not change

the original value of the argument in the calling function?


Call by passing the value of the argument

Every AVL tree is a binary search tree.

TRUE

The difference between a "Binary Tree (BT)" and a "Binary

Search Tree (BST)" is that,

In BST nodes are inserted based on the values they contain

The worst case of searching in binary search tree (BST) is:

When the data inserted in BST is sorted

Suppose there are 100 elements in an equivalence class, so

initially there will be 100 trees. The collection of these trees is

called

Forest

Factorial is an example of ________ function.

Recusive
Suppose a hash function returns 6 for the given value. At which

indexof array the value will be saved?

A binary tree of N nodes has _____________ .

Log2 N levels

Every AVL is ___________.

Binary Search Tree

If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad

is also cousin of Asad. This statement has the following

property

Transitivity

What is the time complexity of binary search with iteration?

O(logn)

A solution is said to be efficient if it solves the problem within its

resource constraints i.e. hardware and time.


True

Searching an element in an AVL tree takes maximum _______

time (where n is number of nodes in AVL tree).

1.44 Log2n

Which of the following is not a form of exoression?

Pastfix

Heap can be used to implement

Priority Queue

Sorting procedure normally takes ________ time.

NLogN

Consider we have performed the following operations on stack

of size 5.

Push(10);

Push(20);

Push(30);
Pop();

Pop();

Push(40);

20

Which one of the following is NOT the property of equivalence

relation?

Associative

What is the hash function used in linear probing?

hi(x)= (hash(x)+ f(i)) mod table size

Recursive call of a function use ________ data structure.

Stack

Left, right, info, and parent are the operation of ________ data

structure.

Tree
For Binary Search Tree, we call the findMax() method as

________.

findMin(tree->getLeft())

From Operating System point of view, the recursive function

calls are made with the help of ________.

Stack

Which of the following is true regarding the maze generation?

All of the given

If there are 100 elements in an equivalence class then we will

have ________ sets initially.

100

given the values are the array representation of heap: 12 23 26

31 34 44 56 64 78 100

What is the 5th smallest element in the given heap?

34
Which operation of queue data structure is used to get front

element from the queue and then remove it from the queue?

enqueue()

________ is an area in computer memory that is allocated

dynamically.

Heap

The tree structure is a

Non-linear data structure

Binary Tree traversal can be performed with the help of

________ .

Both Recursive and Non-recursive calls

New items are added at the ________ of the stack.

Top

Leaf node of binary search tree contains ________.

All of the given


Suppose there are a set of fruits and a set of vegetables. Both

sets are ________ sets.

Disjoint

Which of the following operations returns "most recently

entered value" from the stack?

Top

back() method of list class is used to:

Moves the "current" pointer to backward one element.

Stack and Queue can be implemented using ________.

Singly Link List

The array in binary search is sub divided ________.

Untill a sublist is no more divisible

Which of the following heap method lowers the value of key at

position 'p' by the amount 'delta'?

decreaseKey(p,delta)
What will be the postfix expression of following infix

expression?

A*B/C+D-E

AB+CD/+E-

An efficient program executes faster and helps in ________ the

usage of resources like memory and disk.

Maximizing

Array cells are ________ in computer memory.

Contiguous

Suppose there is an image of 7 * 7, now we will have matrix of

________ rows and ________ columns.

7, 7

An array is a group of ________ memory locations.

Consecutive
for every process executing, the last part of the memory is for

________ of the program.

Heap

What will be the postfix expression of following infix

expression?

D+E*F/G

DEF*G/+

The expression

if (! heap ->isEmpty() )

checks

Heap is not empty

________ is used for Reference variables in C++.

&

For searching a particular number in Binary Search Tree (if it is

not present), the maximum number of comparisons will be

________ comparison at each level.


2

Suppose n is the number of nodes in a complete Binary Tree,

then maximum steps required for a search operation are

Log2 (n+1) -1

If we use array to implement list, then there is an issue that it

gives difficulty when:

We will increase its size

Consider the following function:

void test_a(int n)

cout << n << " ";

if (n>0)

test_a(n-2);

What is printed by the call test_a(4)?

420
Doubly Linked List always has ________ NULL pointer/s in a

node.

Two

The percolateDown procedure will move the smaller value

________ and bigger value ________.

up, down

What will be the result of evaluation following expression?

5+3*2/(6-3)

_________ only removes items in reverse order as they were

entered.

Stack

Linked list always contains elements that can be described as,

Self-referential
What will be postfix expression of the following infix

expression?

Infix Expression: a+b*c-d

abc*+d-

In tree, the search operation is ________ as compared to the

linked list.

Very fast

Each node in doubly link list has

1 pointer

Which of the is NOT true regarding the maze generation?

Remove a randomly chosen wall if the cells it separates are

alreadly in same set

The new operation in C++ for dynamically allocating memory

returns,

Pointer to the memory it has allocated


Which of the following applications may use a stack?

Parentheses balancing program

Which one of the following statement is correct?

Array size is fixed once it is created

What will be result of following postfix expression?

123*+2-

When we compare recursive method calls and non-recursive

method calls, following statement is true.

Recursion is implementted in the same way as other

functioncalls are implemented

A queue where the dequeue operation does not depend upon

FIFO, is called:

Priority queue
A Linear Data Structure is the data structure in which data

elements are arranged in a sequence or a linear list. Which of

the following is Non Linear Data Structure?

Binary Search Trees

________ is the stack characteristic but ________ was

implemented because of the size limitation of the array.

isEmpty(), isFull()

Y = &x[0];

In the above statement, we get address of the first location of

the array x and store

it in y. Here "y" is:

lvalue

Each node in singly link list has,

1 pointer
If ahmad is boss of ehsan and ehsan is boss of umer then

ahmad is also boss of umer.

The above mentioned relation is ________.

Transitive

Which of the following possible operation are performed on

Table ADT?

Insert, Find, Remove

Which of the following operation returns but do not removes top

value of the stack?

top

While implementing non-recusive traversal for Binary

SearchTree, we need to implement ________ .

Stack

~BinarySearchTree() is a ________ .

Constructor
Which property of equivalence relation is satisfied if we say:

Ahmad is cousin of Ali and Ali is also cousin of Ahmad

Symmetry

The total number of nodes on 5th level of a perfect binary tree

are :

32

In C++, we place the class interface in ________ file.

.cpp

The variables which are destroyed automatically when a

function's execution ends are:

Local variables defined inside function body

If the elements are 3, 5, 1,6 in which order they will be removed

from the queue one by one

3516
The……..of a binary tree is a maximum level of its leaves (also

the depth).

height

………of the an empty AVL tree is define to be

Height

Following is the keyword of c++

Delete

In the perspective of memory organization every process

expecting the first part of memory is for…..of the program.

code

The……..of a node in a binary tree is define as the height of its

left subtree minus height of its right subtree.

balance

If p is pointing to a node in an existing tree then info (p)means

Return the content of node p.


Following is a keyword of c++……

Delete

Every…….tree is a binary search tree

AVL

If a function has recursive call as last statement it is known

as……

Tail recursive

During in a order traversal call if we found a node is null it

means this node will satisfy following condition

it will not have left child

In binary search tree deleting a node is easy if it is a…… node

Root

Which of the following operation returns the content of binary

tree node?

Info (p)
1 2 6

5 8

1234568

in a complete binary tree the number of node of level 5 are

30

One should be careful about transient…….that are stored by

reference I data structure

Objects

In a tree we link the node in such a way that it………..a linear

structure

does not remain

the function call are mode with the help of………..


stack

18. 15 25 45

35 75

15 35 25 75 45

A binary is said to be a……binary tree if every non leaf node in

binary tree has non empty left and right structure

Strictly

In which of the following function signature the value of variable

num cannot be changed in function body

Binary search tree

Two common method of simulations are………are…….

Time based simulation and event based simulation

Generally there are case (s)to delete a node from BST

1
When a function calls another function the parameters and

address of the calling function are put in…

Stock

Binary search tree ()is a…….

Destructor

We can calculate the…….of subtree by counting its level from

the bottom

Nodes

If there is a strictly complete binary tree of depth 3 the total

number of nodes it will be

A …….model attempt to model real word phenomenon

Simulation

The process of getting the value of a variable using a pointer is

called
Dereferencing

When a function calling itself is called as……..

Recursion

A………is a tree in which every except possibly the last, is

completely filled

Strict binary tree

In AVL tree during insertion, a single rotation can fix the

balance in cases _________ and 4.

If a node is inserted in outer side of a node in binary search

tree then to make it AVL tree,

We may have to apply single rotation

A zigzag rotation is performed. In Left-Left case of rotation in

AVL tree.

False
The principal benefit of a linked list over a conventional array is

that the order of the linked items may be_______ from the

order that the data items are stored in memory.

Same

Stack.push(15) will push 15 on _________.

Top of the stack

Suppose we have the following values to be inserted in

constructing AVL tree,

10,13,15,5,7,8

Tell when first rotation will take place,

After inserting the node 15

All the objects created using ___________ operator have to be

explicitly destroyed using the delete operator.

New
During the execution of a process, operating system constructs

four things for that process. Which of the following is not part of

that process?

Linked list

There are _________cases of Rotation in AVL tree.

Which of the following line of code is incorrect?

Float *I = float new (not confirmed)

In simple or singly linked list there is/are ________ pointer/s in

each node.

One

Suppose there are three nodes tree with three numbers 14, 4,

15. Following is not a permutation, or combination for output

them.

(4, 4, 15)
The type of expression in which operator succeeds its

operands is___________expression.

Postfix

The _________ of a node in a binary tree is defined as the

height of its left subtree minus height of its right subtree.

Balance

If both left and right nodes of a node are NULL then this type of

node is called a ______ node.

Non leaf (not confirmed)

The function calls are made with the help of__________.

Stack

Which data structure is needed to convert infix expression to

postfix expression?

Stack

In case of insertion of right inner node in BST,


Left rotation then right to make AVL

A BST generated from the data in ascending order is

____________.

Linear

Which operation of queue data structure is used to get front

element from the queue and then remove it from the queue?

Remove ()

In _________ various cells of memory are not located

continuously.

Linked list

The _______ method of list will position the currentNode and

lastCurrentNode at the start of the list.

Start

Which operation of queue data structure is used to insert an

element into the Queue?


Enqueuer ()

From Operating System point of view, the recursive function

calls are made with the help of __________.

Queue

We can make a lexicographic order of characters based on

their _____________.

ASCII values

What are the basic things associated with data structures?

All of the above

Consider the following push operations of a Stack:

Stack.push(4);

Stack.push(6);

Stack.push(5);

Stack.push(8);
If a user calls a pop() operation, then which value will be

returned?

8 (stack is last in fist out)

~BinarySearchTree( ) is a _______________.

Destructor

Array cells are _________ in computer memory.

Contiguous

Leaf node of binary search tree contains ________

One Null Pointer

dequeue() operation of queue data structure is used

to____________

remove an element from the front and return it

The depth of a binary tree is

Maximum level of a leaf


Which of the following operation returns but do not removes top

value of the stack?

Top

Which of the following data structure is linear type?

All of above

In doubly linked list a node consists of three parts:

2 pointers and 1 object

Last node in circular linked list contains

No null pointer

A_________ model attempts to model a real-world

phenomenon

Simulation

Factorial is an example of __________function.

Recursive
The balance of a node in a binary tree is defined as the height

of its _______ sub tree minus height of its right sub tree.

Left

In case of insertion of left outer node in BST,

We first apply left rotation and then rotation to make it an AVL

Tree.

int htdiff = height(root->getLeft()) height(root->getRight()); The

above line of code is taken from AVL insert method. Complete

it by selecting an appropriate symbol.

Minus (-)

Each operator in a postfix expression refers to the previous

_______ operand(s).

Two

For making Binary Search Tree for Strings we need, ________

data type.
Int

A _________model attempts to model a real-world

phenomenon

Simulation

The lifetime of a transient object cannot exceed that of the

application.

True

Which one of the following calling method does not change the

original value of the argument in the calling function?

Call by passing the value of the argument

In level-order traversal for Binary Search Tree, we visit the

nodes at each level before proceeding to the next level, in a

_________ order.

Left-to-right

In doubly linked list a node consists of three parts:


1 pointer and 2 objects

Binary Search Tree voilates the condition of AVL tree when any

node has balance equal to

1 or -1

To search an element in ALV tree, it takes maximum 1.88 Log

2n time

True

HOW many cases of rotation are there in AVL tree?

__________ tree has been named after two persons Adelson-

Velskii and Landis.

AVL

Which of the following is a nonlinear data structure?

Tree

AVL tree is nonlinear data structure.


True

_________ is when function is calling to itself.

Recursion

Which of the following function don't belongs to the stack

class?

Crash ()

Which one is the cored function call for the following function of

calculating cube?

int cube(int& num)

cube (num)

Binary search algorithm cannot be applied to ____

None of the given

copy() method of list data structure __________

Set one list to be a copy of another


While implementing non-recursive traversal for Binary Search

Tree, we need to implement

Stack

Following is true in case of using Recursive method calls

The code becomes very short

________is a self-balancing tree.

Binary Search Tree

While implementing stack with an array and to achieve LIFO

behavior, we used push and pop elements at

The start of the array

Generalized code written for a class is called

Structure

Army cells are ___________ in computer memory

Contiguous
In singly linked list a node comprises of __________ field/s.

Two

Which of the following statement is false?

Pointers store the next data element of a list

Leaf node of binary search tree contains ________

One null Pointer

What will be the result of evaluating following expression?

5+3*2/(6-3)

Want and de-allocatmg memory for linked lest nodes does take

hrne than pre-allocated array

MORE

Suppose you are writing a class for Node class and forgot to

write the constructor of the class, then

Compiler will automatically generate a default constructor


Factorial is an example of __________function.

Recursive

A binary tree is said to be a _____ binary tree if every non-leaf

node in a binary tree has non-empty left and right subtrees.

Strictly

Memory address is stored in

Pointer

In level-order traversal for Binary Search Tree, __________

data structure is used.

Queue

Which of the following is the correct option for priority Queue?

The type of queues that is FIFO i.e. the person who comes first

should leave first.

AVL tree is linear data structure.

False
AVL tree is a binary search tree

True

The post order traversal of a binary tree is DEBFCA. Find out

the pre order traversal

B C

Ʌ ̸

DEF

ABDCEF

In a tree, we link the nodes in such a way that it ___________

a linear structure.

Does not remain


add(12) method of linked list class will:

Add 12 as value in linked list

Which of the following is the correct conversion of infix to

postfix expression?

Z+B-(D-H)/K

ZB+DH-K/-

In singly linked list “next” field of node contains:

Address of next node

Which of the following line of code is incorrect?

The lifetime of a transient object can exceed that of the

application which is accessing it.

A list is the collection of items of the _________

same type

back() method of List class is used to:


Moves the “current” pointer to backward one element.

Suppose you are writing a class for Node class and forgot to

write the constructor of the class, then

_________ is the maximum height of the AVL tree.

1.44log2n

length() method of List class is used to:

Return the length of the list

There are four cases of rotation in an __________ tree.

AVL

Allocating and de-allocating memory for linked list nodes does

take _________ time than pre-allocated array.

More

________ is utilized at the time of memory allocation in

dynamic manner.

Heap
In which case of insertion we require double rotation to make

the AVL tree balance.

None

The back() method decreases the value of variable current by

__________.

One

In array list the worst case of removing an element is

To remove the item from start

Left, right, info, and parent are the operations of _________

data structure.

Tree

Which of the following is TRUE for search operations in a

binary tree as compared to linked list or an array?

It increase the number of comparison

Which of the following is a correct statement?


An AVL tree is identical to BST except the height of left and

right subtree can differ by at least 1

length() method of List class is used to:

Return the length of the list

Whenever we call a function, the compiler makes a stack, the

top element of the stack is _______ of the function.

Return Address

Whenever we call a function, the compiler makes a _________

that it uses to fulfill this function call.

Stack

_______ is the major factor to see the efficiency of a program.

Time

__________ rule applies for evaluating operators of same

precedence in an expression

None
The postfix form of the expression A + B * C and (A + B) * C will

be _______.

Same

If we use array to implement list, then there is an issue that it

gives difficulty when:

We will access value randomly

During in-order traversal using recursive calls, if we found a

node is NULL. It means this node will satisfy following

condition.

It will not have left child

Which one the following is more closer to AVL tree, (chose the

best option)

Binary Search Tree

start() method of List class is used to:

Move the current pointer to first element


Consider the following infix expression.7/8 + 9

If one converts the above expression into postfix, what would

be the resultant expression?

78/9+

In internal memory organization of a process, there is some

area of memory for static data that holds ____________

variables.

Both Static and Global

In Left-Right case of rotation in ________ tree. A double

rotation is performed.

AVL

If numbers 5, 222, 4, 48 are inserted in a queue, which one will

be removed first?

Which one is not the property of binary tree?


Sibling node should be same parent (Not Sure)

Each node in singly linked list contains_______

One Pointers

What's wrong with following loop? while( (i < 10) && (i > 24)) { }

The Condition is always false

Which one of the following is TRUE about recursion?

1. Recursive function calls consume a lot of memory.

2. Recursion extensively uses stack memory.

3. Recursion extensively uses stack memory.

4. Iteration is more efficient than iteration.

Which of the following is not a data structure ?


1. Linked list

2. Queue

3. stack

4. Memory cell

“+” is a _________operator.

1. Unary

2. Binary

3. Ternary

4. None of the above

When an executable program run, it is loaded in the memory

and becomes a_______.

1. Thread

2. .h file

3. Process
4. None of the above

www.vustudents.ning.com

In array list the worst case of removing an element is

1. To remove an element from the end of the list

2. To remove an element from the middle of the list

3. To remove an element from the start of the list

4. We cannot remove element from an array list

The tree data structure is a

1. Linear data structure

2. Graphical data structure

3. Non-linear data structure (Not Confirm)

4. Data structure like queue


In______, a programmer uses two pointers in the node, i.e. one

to point to next node and the other to point to the previous

node.

1. Linked list

2. doubly-link list

3. array

4. Structure

Each operator in a postfix expression refers to the previous

______ operand(s)

1. one

2. two

3. three

4. four
Which of the following operations returns top value of the

stack?

1. push

2. pop

3. top

4. First

In the calling function, after the execution of the function called,

the program continues its execution form the _______after the

function call.

1. Previous line

2. Next line
3. Beginning

4. None of the above

________ only removes items in reverse order as they were

entered.

1. Queue

2. Stack

3. Both of these

4. None of these

In the linked list implementation of the stack class, where does

the push member function places the new entry on the linked

list?
1. After all other entries that are greater than the new entry.

2. At the head

3. After all other entries that are smaller than the new entry.

4. At the tail

Which of the following is known as "Last-In, First-Out" or LIFO

Data Structure?

1. Linked List

2. Stack

3. Queue

4. Tree

A queue is a ________data structure, whereas a stack is a

________data structure.
1. FIFO, LIFO

Each node in doubly link list has

1. 2

2. 3

3. 4

Whenever we call a function, the compiler makes a stack, the

top element of the stack is _____ of the function


1. First argument

2. Return address

3. Last argument

4. none of the obove

_____ is the stack characteristic but _______was implemented

because of the size limitation of the array.

1. isFull(),isEmpty()

2. pop(), push()

3. isEmpty() , isFull()

Stack and Queue can be implemented using _______,


1. Singly Link List

2. Binary Tree

3. Binary Search Tree

4. AVL Tree

The _____ method of list will position the currentNode and

lastCurrentNode at the start of the list.

1. Remove

2. next

3. start

4. back

In array list the worst case of removing an element is


1. To remove an element from the end of the lis

2. To remove an element from the middle of the list

3. To remove an element from the start of the list

4. We cannot remove element from an array list

STL is a ________ that is a part of the official standard of C++.

1. C program file

2. .h file

When an executable program run, it is loaded in the memory

and becomes a_____.


1. Thread

2. .h file

3. Process

4. None of the above

Each node in doubly link list has,

1. pointer

2. pointers

3. pointers

4. pointer

A queue is a ________data structure, whereas a stack is a


________data structure.

1. FIFO, LIFO

2. LIFO,FIFO

3. both of these

4. none of these

Which one of the following is TRUE about recursion?

1. Recursive function calls consume a lot of memory.

2. Recursion extensively uses stack memory.

3. Recursion extensively uses stack memory.


4. Iteration is more efficient than iteration.

To create a _________ we link the last node with the first node

in the list.

1. Double linked list

2. Circularly-linked list

3. Linked list

4. None of the above


_____ is the stack characteristic but _______was implemented

because of the size limitation of the array.

1. isFull(),isEmpty()

2. pop(), push()

3. isEmpty() , isFull()

4. push(),pop()

The principal benefit of a linked list over a conventional array is

that the order of the linked items may be_____ from the order

that the data items are stored in memory.

1. Same
2. Identical

3. Different

4. Equivalent

In________ the ‘next’ returns false when it reaches to the last

node due to the fact that the next field of the last node is set to

NULL.

1. Circular linked list

2. Triple linked list

3. Singly linked list

4. None of the above


If numbers 5, 222, 4, 48 are inserted in a queue, which one will

be removed first?

1. 48

2. 4

3. 333

4. 5

Which boolean expression indicates whether the numbers in

two nodes (p and q) are the same. Assume that neither p nor q

is null.

1. p == q
2. p.data == q.data

3. p.nextNode == q. nextNode

4. p.data == q

Local variables of a function are stored in,

1. Binary Search Tree

2. Stack

3. Queue

4. AVL Tree
A queue is a data structure where elements are

1. inserted at the front and removed from the back.

2. inserted and removed from the top.

3. inserted at the back and removed from the front.

4. inserted and removed from both ends.

A kind of expressions where the operator is present between

two operands called ________expressions.

1. Infix
2. Postfix

3. Prefix

4. None of the above

A template is a function or class that is written with a

__________data type.

1. Specific

2. Definite

3. Generic

4. None of the above.


Whenever we call a function, the compiler makes a stack, the

top element of the stack is _____ of the function.

1. First argument

2. Return address

3. Last argument

4. None of the above

Which of the following can be used to reverse a string value,

1. Stack
2. Queue

3. Both of these

4. None of these

A queue is a ________data structure, whereas a stack is a

________data structure.

1. FIFO, LIFO

2. LIFO,FIFO

3. both of these

4. none of these
Stack and Queue can be implemented using _______,

1. Singly Link List

2. Binary Tree

3. Binary Search Tree

4. AVL Tree

Which of the following is not a data structure ?

1. Linked list

2. Stack

3. Queue

4. Memory cell
Compiler uses which one of the following in Function calls,

1. Stack

2. Queue

3. Binary Search Tree

4. AVL Tree

The principal benefit of a linked list over a conventional array is

that the order of the linked items may be_____ from the order

that the data items are stored in memory.

1. Same
2. Identical

3. Different

4. Equivalent

Doubly Linked List always has one NULL pointer.

1. True

2. False

We cannot remove items randomly from _________

1. Stack

2. Queue
3. Both of these

4. None of these

______ is the maximum number of nodes that you can have on

a stack-linked list ?

1. Zero

2. 2n (where n is the number of nodes in linked list)

3. Any Number

4. None of these
“+” is a _________operator.

1. Unary

2. Binary

3. Ternary

4. None of the above

In______, a programmer uses two pointers in the node, i.e. one

to point to next node and the other to point to the previous

node.

1. Linked list

2. doubly-link list

3. array
4. structure

A queue is a data structure where elements are

1. inserted at the front and removed from the back.

2. inserted and removed from the top.

3. inserted at the back and removed from the front.

4. inserted and removed from both ends.

_____ is the stack characteristic but _______was implemented

because of the size limitation of the array.

1. isFull(),isEmpty()

2. pop(), push()

3. isEmpty() , isFull()
4. push(),pop()

The _____ method of list will position the currentNode and

lastCurrentNode at the start of the list.

1. Remove

2. Next

3. Start

4. Back

Parameters in function call are passed using,

1. Stack
2. Queue

3. Binary Search Tree

4. AVL Tree

If numbers 5, 222, 4, 48 are inserted in a queue, which one will

be removed first?

1. 48

2. 4

3. 333

4. 5

For a perfect binary tree of height 4, what will be the sum of

highest of node
1. 31

2. 30

3. 27

4. 26

If Ahmed is cousin of Ali and Ali is cousin of Asad then Ahmed

is also cousin of Asad. Thisstatement has the following property

1. Reflexivity

2. Symmetry

3. Transitivity

4. All of the above


Which one of the following is NOT the property of equivalence

relation?

1. Reflexive

2. Symmetric

3. Transitive

4. Associative

The main reason of using heap in priority queue is

1. Improve performance

2. Code readable

3. Less code

4. Heap can’t be used in priority queues


The total numbers of nodes on 10th level of perfect binary tree

are

1. 256

2. 512

3. 1024

4. Can’t be determined

Suppose there are 100 elements in an equivalence class, so

initially there will be 100 trees,the collection of these trees is

called _____.

1. Cluster

2. Class

3. Forest
4. Bunch

The percolate Down procedure will move the smaller value and

bigger value.

1. Left, right

2. Right, left

3. Down, up

4. Up, down

For a perfect binary tree of height h, having N nodes, the Sum

of height of nodes is

1. N - h -1
2. N - 1

3. N - 1 + h

4. N - (h - 1)

Which of the following method is helpful in creating the heap at

once?

1. Insert

2. Add

3. Update

4. percolateDown

If ahmad is boss of ehsan and ehsan is boss of umer then

ahmad is also boss of


umer, theabove-mentioned relation is_______ .

1. Reflexive

2. Symmetry

3. Transitive

4. None of given

If we want to find median of 50 elements, then after applying

builtHeap method, how manytime deleteMin method will be

called?

1. 5

2. 25

3. 35
4. 50

Which of the following properties are satisfied by equivalence

relationship?

1. Reflexive, symmetric

2. Reflexive, transitive

3. Symmetric, transitive

4. Reflexive, symmetric and transitive

Sorting procedure normally takes___ time.

1. NlogN

2. 2N
3. N*N*N

4. N

15. The Expression

if ( ! heap->isFull() )

Check

1. Heap is empty

2. Heap is full

3. Heap is not empty

4. Heap is not full

The Expression

if ( ! heap->isEmpty() )
Check

1. Heap is empty

2. Heap is full

3. Heap is not empty

4. Not a valid expression

Given the values are the array representation of heap:12 23 26

31 34 44 56 64 78

100 If we perform 4 deleteMin operation, the last element

deleted is__________ .

1. 31

2. 34
3. 44

4. 56

Which of the following heap method increase the value if key at

position ‘p’ by the amount‘delta’?

1. increaseKey(p, delta)

2. decreaseKey(p, delta)

3. percolateDown(p, delta)

4. remove(p, delta)

Which of the following heap method lowers the value if key at

position ‘p’ by the amount ‘delta’?

1. increaseKey(p, delta)
2. decreaseKey(p, delta)

3. percolateDown(p, delta)

4. remove(p, delta)

Which property of equivalence relation is satisfied if we say:

Ahmad R(is related to)Ahmad

1. Reflexivity

2. Symmetry

3. Transitivity

4. All of Above
Given the values are the array representation of heap;12 23 26

31 34 44 56 64 78 100 What is the 5th smallest element in the

given heap?

1. 31

2. 34

3. 44

4. 56

The _________ of a binary tree is the maximum level of its

leaves (also called the depth).

Select correct option:

Level

Width

Height

None of the above


Question # 2 of 10 ( Start time: 06:40:41 PM ) Total Marks: 1

If we write functions for recursive and non recursive inorder

traversal method of BST, what will be the difference between its

functions prototypes?

Select correct option:

Different return types

Different function names

Different arguments list

Nothing will be different

Question # 3 of 10 ( Start time: 06:40:41 PM ) Total Marks: 1

binary tree whose every node has either zero or two children is

called _________

Select correct option:

Complete binary tree

Binary search tree


Strictly binary tree

None of above

Question # 4 of 10 ( Start time: 06:40:41 PM ) Total Marks: 1

Which one of the following calling method does not change the

original value of the argument in the calling function?

Select correct option:

Call by passing reference of the argument

Call by passing the address of the argument

Call by passing the value of the argument

None of the given options

Question # 5 of 10 ( Start time: 06:40:41 PM ) Total Marks: 1

Longest path from root node to farthest leaf node is called

________ of tree

Select correct option:

Level
Length

Depth

Node level

Question # 6 of 10 ( Start time: 06:40:41 PM ) Total Marks: 1

Which of the following statement is false?

Select correct option:

Arrays are dense lists and static data structure

data elements in linked list need not be stored in adjecent

space in memory

pointers store the next data element of a list

linked lists are collection of the nodes that contain information

part and next pointer

The _________ of a node in a binary tree is defined as the

height of its left subtree minus height of its right subtree.

Select correct option:


Height

Balance

Width

None of the above

A tree is an AVL tree if

Select correct option:

Any one node fulfills the AVL condition

At least half of the nodes fulfill the AVL condition

All the nodes fulfill the AVL condition

None of the given options

In a program a reference variable, say x, can be declared as

Select correct option:

int &x ;

int *x ;

int x ;
None of the given options

In which of the following functions, the value of variable cannot

be changed in function body?

Select correct option:

int cube( int num)

int cube(int& num)

int cube(const int& num)

int cube(int* num)

My todays quizzz no 1
1.When an executable program run, it is loaded in the memory and becomes
a_______.
Select correct option:
Thread
.h file
Process
None of the above

2.A kind of expressions where the operator is present between two operands called
________expressions.
Select correct option:
Infix
Postfix
Prefix
None of the above

3.Which of the following operations returns top value of the stack?


Select correct option:
push
pop
top
first

4.To create a _________ we link the last node with the first node in the list.
Select correct option:
Double linked list
Circularly-linked list
Linked list
None of the above

5.In the calling function, after the execution of the function called, the program
continues its execution form the _______after the function call.
Select correct option:
Previous line
Next line
Beginning
None of the above

6.Doubly Linked List always has one NULL pointer.


Select correct option:
True
False
7. ________ only removes items in reverse order as they were entered.
Select correct option:
Queue
Stack
Both of these
None of these

8.In the linked list implementation of the stack class, where does the push member
function places the new entry on the linked list?
Select correct option:
After all other entries that are greater than the new entry.
At the head
After all other entries that are smaller than the new entry.
At the tail

9.Which of the following is known as "Last-In, First-Out" or LIFO Data Structure?


Select correct option:
Linked List
Stack
Queue
Tree
10.Which boolean expression indicates whether the numbers in two nodes (p and q)
are the same. Assume that neither p nor q is null.
Select correct option:
p == q
p.data == q.data
p.nextNode == q. nextNode
p.data == q
1. Local variables of a function are stored in,
Select correct option:
Binary Search Tree
Stack
Queue
AVL Tree
• 2. Question # 2 of 5 ( Start time: 11:41:31 AM )
When an executable program run, it is loaded in the memory and becomes a_______.
Select correct option:
Thread
.h file
Process
None of the above
• 3. In________ the ‘next’ returns false when it reaches to the last node due to the
fact that the next field of the last node is set to NULL.
Select correct option:
Circular linked list
Triple linked list
Singly linked list

None of the above


• 4. A kind of expressions where the operator is present between two operands
called ________expressions.
Select correct option:

Infix

Postfix

Prefix

None of the above


• 5. Question # 1 of 5 ( Start time: 11:44:44 AM ) Total Marks: 1
Compiler uses which one of the following in Function calls,
Select correct option:

Stack
Queue

Binary Search Tree

AVL Tree

• 6. Stack and Queue can be implemented using _______,

Select correct option:

Singly Link List

Binary Tree

Binary Search Tree

AVL Tree
7. Which one of the following is TRUE about recursion?
Select correct option:

Recursive function calls consume a lot of memory.

Recursion extensively uses stack memory.

Recursion extensively uses stack memory.

Iteration is more efficient than iteration.


8. Doubly Linked List always has one NULL pointer.
Select correct option:

True

False

9. Which boolean expression indicates whether the numbers in two nodes (p and q) are the
same. Assume that neither p nor q is null.
Select correct option:

p == q
p.data == q.data
p.nextNode == q. nextNode
p.data == q

10. Whenever we call a function, the compiler makes a stack, the top element of the stack
is _____ of the function.
Select correct option:

First argument
Return address
Last argument
None of the above

11.
_____ is the stack characteristic but _______was implemented because of the size limitation
of the array.
Select correct option:

isFull(),isEmpty()
pop(), push()
isEmpty() , isFull()
push(),pop()

12.
Each operator in a postfix expression refers to the previous ______ operand(s).
Select correct option:

one
two
three
four
13The next field in the last node in a singly-linked list is set to_____.
Select correct option:

0
1
NULL
false

14.
The _____ method of list will position the currentNode and lastCurrentNode at the start of
the list.
Select correct option:
Remove
Next
Start
Back
15.
______ is the maximum number of nodes that you can have on a stack-linked list ?
Select correct option:
Zero
2n (where n is the number of nodes in linked list)
Any Number
None of these

16.
In the linked list implementation of the stack class, where does the push member function
places the new entry on the linked list?
Select correct option:

After all other entries that are greater than the new entry.
At the head
After all other entries that are smaller than the new entry.
At the tail

17. Which of the following operations returns top value of the stack?
Select correct option:

push
pop
top
first

18. it will be efficient to place stack elements at the start of the list because insertion and
removal take _______time.
Select correct option:

Variable
Constant
Inconsistent
None of the above

19. A template is a function or class that is written with a __________data type.


Select correct option:

Specific
Definite
Generic
None of the above.
20. Local variables of a function are stored in,
Select correct option:
Binary Search Tree
Stack
Queue
AVL Tree

21. To create a _________ we link the last node with the first node in the list.
Select correct option:
Double linked list
Circularly-linked list
Linked list
None of the above

22. In the calling function, after the execution of the function called, the program continues
its execution form the _______after the function call.
Select correct option:
Previous line
Next line
Beginning
None of the above

23. Which of the following can be used to reverse a string value,


Select correct option:
Stack
Queue
Both of these
None of these

24. Question # 4 of 5 ( Start time: 05:32:20 PM ) Total Marks: 1


Each node in doubly link list has,
Select correct option:
1 pointer
2 pointers
3 pointers
4 pointers

25. In________ the ‘next’ returns false when it reaches to the last node due to the fact that the
next field of the last node is set to NULL.
Select correct option:
Circular linked list
Triple linked list
Singly linked list
None of the above
26. only removes items in reverse order as they were entered.
Select correct option:

Queue
Stack
Both of these
None of these

27. A queue is a ________data structure, whereas a stack is a ________data structure.


Select correct option:

FIFO, LIFO
LIFO,FIFO
both of these
none of these

28. The principal benefit of a linked list over a conventional array is that the order of the
linked items may be_____ from the order that the data items are stored in memory.
Select correct option:

Same
Identical
Different
Equivalent

29. Whenever we call a function, the compiler makes a stack, the top element of the stack
is _____ of the function.
Select correct option:

First argument
Return address
Last argument
None of the above

30. The _____ method of list will position the current Node and lastCurrentNode at the start
of the list.
Select correct option:

Remove
Next
Start
Back
See the below code and fill the appropriate answer for? void fastInorder(TreeNode*
p) { while((p=nexInorder(p)) != ? ) cout p->getInfo(); }
Dummy
rootNode
LTH
RTH

If there are N external nodes is a binary tree then what will be the no. of the
internal nodes in this binary tree?
N-1
N
N+1
N+2

An expression tree will always be a,


Complete binary tree
Binary search tree
Heap AVL tree

When a complete binary tree represented by an array then if right child is at


position 5 then left child will be at position _____
2
3
4
6

Consider a binary tree, represented by the following array: A,B,C,D,E,F,G,I Is


it a strictly binary tree ?
Yes
No

In a min heap the parent node has key smaller than or equal to
Left child
Right child
Both
None

The expression if ( ! heap->isEmpty() ) checks


Heap is empty
Heap is full
Heap is not empty
Not a valid expression (not confirm)
We implement the heap by
Threaded Tree
AVL tree
Complete binary tree
Expression

For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
n-(h-1)
n-(h+1)
n-h
none

Traversing a binary tree can only be done using


Recursion
Iteration
Both
none

For a perfect binary tree of height 4. What will be the sum of heights of nodes?
31
3027
26
For a perfect binary tree of height h, having N nodes, the sum of heights of nodes is
_____________.
N – (h – 1)
N – (h + 1)
N–1
N–1+h

If we want to find median of 50 elements, then after applying buildHeap method, how
many times deleteMin method will be called ?
5
25
35
50

Which of the following heap method increase the value of key at position ‘p’ by the
amount ‘delta’?
increaseKey(p,delta)
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)

www.vuzs.net
The main reason of using heap in priority queue is
improve performance
code is readable
less code
heap can't be used in priority queues
The total number of nodes on 10th level of a perfect binary tree are :
256
512
1024
Can't be determined

Which property of equivalence relation is satisfied if we say: Ahmad R(is related to)
Ahmad
Reflexivity
Symmetry
Transitivity
All of the above

Which of the following heap method lowers the value of key at position ‘p’ by the
amount ‘delta’?
increaseKey(p,delta)
decreaseKey(p,delta)
preculateDown(p,delta)
remove(p,delta)

We can build a heap in _____ time.


Linear
Exponential
Polynomial
None of the given options

we can build a heap in linear time using n calls of percolate_down()

If a tree has 50 nodes, then the total edges/links in the tree will be :
55
51
50
49 N-1= 49
Consider a max heap, represented by the following array;
40,30,20,10,15,16,17,18,4 After inserting a nodes with value 35.Which of
following is the updated max heap?
40,30,20,10,15,16,17,8,4,35
40,30,20,10,35,16,17,8,4,15
40,35,20,10,30,16,17,8,4,15
40,35,20,10,15,16,17,18,4,30

A Threaded Binary Tree is a binary tree in which every node that does not have
a right child has a THREAD (in actual sense, a Link) ___________Successor.
Preorder
Inorder
Postorder
Leveloder

Which of the following is a property of binary tree?


A Binary tree with N internal nodes has 2+N links, N-1 links to internal nodes and
N+1 links to external nodes
A Binary tree with N internal nodes has 2*N links, N-1 links to internal nodes and
N+1 links to external nodes.
A Binary tree with N internal nodes has 2-N links, N-1 links to internal nodes and
N+1 links to external nodes.
A Binary tree with N internal nodes has 2N links, N+1 links to internal nodes
and N-1 links to external nodes.

A Threaded Binary tree is a binary tree in which every node that does not have
a right child has a THREAD (in actual sense, a link)_____________ successor.
Preoder
Inorder
Postorder
Levelorder
If there are 56 internal nodes in a binary tree then how many external nodes
this binary tree will have?
54
55
56
57

Which of the following statement is correct?


A threaded Binary tree is a binary tree in which every node that does not have a left
child has a THREAD (in actual sense, a link) to its INORDER successor.
A threaded Binary tree is a binary tree in which every node that does not have
a right child has a THREAD (in actual sense, a link) to its PREORDER
successor.
A threaded Binary tree is a binary tree in which every node that does not have a left
child has a THREAD (in actual sense, a link) to its INORDER successor.
A threaded Binary tree is a binary tree in which every node that does not have a right
child has a THREAD (in actual sense, a link) to its POSTORDER predecessor.

It is necessary fro Huffman encoding tree to be,


AVL tree
Binary tree
Complete binary Tree
None of these

A binary tree with 45 internal nodes has _________ links to external nodes.
44
45
46
90
In which of the following tree, parent nodes has key greater than or equal to its
both children?
Max heap
Binary search tree
Threaded Binary tree
Complete Binary tree
If one pointer of the nodes in a binary tree is NULL then it will be a/an
Inner node
Leaf node
External node
Root node
If there are N external nodes is a binary tree then what will be the no. of the
internal nodes in this binary tree?
N-1
N
N+1
N+2

See the below code and fill the appropriate answer for? Void
fastlnorder(TreeNod+p) {while((p+nextInorder(p)) !+ ? ) cout << p->getInfo();}
Dummy
rootNode
LTH
RTH

In threaded binary tree, the NULL pointer are replaced by the.


Preorder successor or Predecessor
Inorder successor or predecessor
Postorder successor or predecessor
NULL pointer are not replaced
In which of the following tree, parent nodes has a key greater than or equal to
its both children?
Max heap
Binary search tree
Threaded Binary three
Complete Binary tree
In Complete binary tree the bottom level is filled from _______.
Left to right
Right to left
Not filled at all
None of the given options

If the bottom level of a binary tree is NOT completely filled, depicts that the
tree is NOT a ________
Complete Binary tree
Threaded Binary Tree
Expression tree
Perfectly compete Binary tree
If an expression tree is correct then its root should have,
An operator
(
)
an operand

In threaded binary tree, the NULL pointers are replaced by the.


Preorder successor or predecessor
Inorder successor or predecessor
Postorder successor or predecessor
NULL pointer are not replaced
A complete binary tree is a tree that is ________ filled, with the possible
exception of the bottom level.
Partially
Completely
Incompletely
Partly
If the bottom level of a binary tree is not completely filled, depicts that the tree
is not a _________.
Expression tree
Threaded binary tree
Complete binary tree
Perfectly complete binary tree
An expression tree will always be a,
Complete binary tree
Binary search tree
Heap AVL tree
Which of the following is a property of binary tree?
A binary tree of N external nodes has N internal node
A Binary tree of N internal nodes has N+1 external node
A Binary tree of N external nodes has N+1 internal node
A Binary tree of N internal has N-1 external node
In a threaded binary tree which nodes have NULL child pointers,
All leaf nodes
Nodes other then leaf nodes
Root Node
None of the nodes

In threaded binary tree, the NULL pointers are replaced by the


preorder successor or predecessor
inorder successor or predecessor
postorder successor or predecessor
NULL pointers are not replaced

A complete binary tree is a tree that is _______ filled, with the possible
exception of the bottom level.
partially
completely
incompletely
partly

Which one of the following is TRUE about iteration?


Iterative function calls consumes a lot of memory
Threaded Binary Trees use the concept of iteration
Iteration extensively uses stack memory
Recursion is more efficient than iteration

We implement the heap by ____________ .


Threaded Tree
AVL tree
Complete binary tree
Expression

Which of the following statement concerning heaps is NOT true?


Traversing a heap in order provides access to the data in numeric or
alphabetical order.
Removing the item at the top provides immediate access to the key value with
highest (or lowest) priority.
Inserting an item is always done at the end of the array, but requires maintaining the
heap property.
A heap may be stored in an array.

Which of the following statement concerning heaps is NOT true?


A heap can be stored in a binary search tree.
A heap can be stored in an array.
A heap can be used to implement a priority queue.
A heap can be used to sort data.

A complete binary tree is a tree that is _________ filled, with the possible
exception of the bottom level.
partially
completely
incompletely
partly

By using __________we avoid the recursive method of traversing a Tree,


which makes use of stacks and consumes a lot of memory and time.
Binary tree only
Heap data structure
Huffman encoding

Which of the following statement is true about dummy node of threaded binary
tree?
The left pointer of dummy node points to the itself while the right pointer points to the
root of tree.
The left pointer of dummy node points to the root node of the tree while the right
pointer points itself i.e. to dummy node.
The left pointer of dummy node points to the root node of the tree while the right
pointer is always NULL.
The right pointer of dummy node points to the itself while the left pointer is always
NULL.
Threaded binary tree
When a complete binary tree, represented by an array then for any array
element at position i, the parent is at position ______ .
2i-1
2i
2i+1
floor(i/2)
When a complete binary tree represented by an array then if right child is at
position 5 then left child will be at position _____
2
3
4
6
A binary tree with N internal nodes has _____ links, _______ links to internal
nodes and ________ links to external nodes.
2N, N-1, N+1
N-1, 2N, N+1
N+1, 2N, N-1
N+1, N-1, 2N
If a binary tree has N + 1 external nodes then,
It has N internal nodes.
It has N-1 internal nodes.
It has N/2 internal nodes.
It has N+2 internal nodes.
A binary tree with 45 internal nodes has _______links to external nodes.
44
45
46
90
Consider a binary tree, represented by the following array: 10,7,9,5,2,1,6,3,4
This is a ________.
Min heap
Max heap (Not Sure)
Threaded binary tree
Binary Search tree
Consider a binary tree, represented by the following array: A,B,C,D,E,F,G,I Is it
a strictly binary tree ?
Yes
No
In threaded binary tree the NULL pointers are replaced by the
preorder successor or predecessor
inorder successor or predecessor
inorder successor or predecessor
NULL pointers are not replaced
Consider a binary tree, represented by the following array:
A,B,C,D,E,F,G,H,I,J,K,L Is it a strictly binary tree?
Yes
No
We implement the heap by ______________ .
Threaded Tree
AVL tree
Complete binary tree
Expression
If there are 56 internal nodes in a binary tree then how many external nodes
this binary tree will have?

► 54
► 55
► 56
► 57

Which of the following statements is correct property of binary trees?

► A binary tree with N internal nodes has N+1 internal links.


► A binary tree with N external nodes has 2N internal nodes.
► A binary tree with N internal nodes has N+1 external nodes.
► None of above statement is a property of the binary tree.
Which of the following is a property of binary tree?
► A binary tree of N external nodes has N internal node.
► A binary tree of N internal nodes has N+ 1 external node.
► A binary tree of N external nodes has N+ 1 internal node.
► A binary tree of N internal nodes has N- 1 external node.

Which of the following statement is true about dummy node of threaded binary
tree?
► The left pointer of dummy node points to the itself while the right pointer
points to the root of tree.
► The left pointer of dummy node points to the root node of the tree while
the right pointer points itself i.e. to dummy node
► The left pointer of dummy node points to the root node of the tree while the
right pointer is always NULL.
► The right pointer of dummy node points to the itself while the left pointer is
always NULL.
If the bottom level of a binary tree is NOT completely filled, depicts that the
tree is NOT a
► Expression tree
► Threaded binary tree
► complete Binary tree
► Perfectly complete Binary tree

Which of the following statement is correct about find(x) operation:


► A find(x) on element x is performed by returning exactly the same node
that is found.
► A find(x) on element x is performed by returning the root of the tree
containing x.
► A find(x) on element x is performed by returning the whole tree itself
containing x.
► A find(x) on element x is performed by returning TRUE.

If there are 23 external nodes in a binary tree then what will be the no. of
internal nodes in this binary tree?
► 23
►2
► 21
► 22
f there are N external nodes in a binary tree then what will be the no. of internal
nodes in this binary tree?
► N -1
► N+1
► N+2
►N

Which of the following statement is correct?


► A Threaded Binary Tree is a binary tree in which every node that does not
have a left child has a THREAD (in actual sense, a link) to its INORDER
successor.
► A Threaded Binary Tree is a binary tree in which every node that does not
have a right child has a THREAD (in actual sense, a link) to its PREOREDR
successor.
► A Threaded Binary Tree is a binary tree in which every node that does
not have a right child has a THREAD (in actual sense, a link) to its INORDER
successor.
► A Threaded Binary Tree is a binary tree in which every node that does not
have a right child has a THREAD (in actual sense, a link) to its POSTORDER
successor.

By using __________we avoid the recursive method of traversing a Tree,


which makes use of stacks and consumes a lot of memory and time.
► Binary tree only
► Threaded binary tree
► Heap data structure
► Huffman encoding

Consider a min heap, represented by the following array:


10,30,20,70,40,50,80,60
After inserting a node with value 31.Which of the following is the updated min
heap?
► 10,30,20,31,40,50,80,60,70
► 10,30,20,70,40,50,80,60,31
► 10,31,20,30,40,50,80,60,31
► 31,10,30,20,70,40,50,80,60
In complete binary tree the bottom level is filled from ________.
► Left to right
► Right to left
► Not filled at all
► None of the given options

In case of deleting a node from AVL tree, rotation could be prolong to


the root node.
► Yes
► No

When an array of object is created dynamically then there is no way to provide


parameterized constructors for array of objects.
True
Flase

Which of the following method is helpful in creating the heap at once?


insert
add
update
preculate Down

You might also like