Menu Navigation

  • Cell: +92(308)611-2254

Study Mid Term Quiz-1 CS301 Data Structures Online

Deleting a leaf node in binary search tree involves setting _______________ pointer/s of that node’s parent as null.
1
2
3
4
A node cannot be deleted, when the node to be deleted has both left and right subtrees.
TRUE
FALSE
An array is a group of consecutive related memory locations.
TRUE
FALSE
Consider the following infix expression: 3 + 5 * 6 – 7 * (8 + 5) Which of the following is a correct equivalent expression(s) for the above?
3 6 5 + * 7 5 8 + - *
3 6 5 7 5 8 + * + - *
3 5 6 + * 7 8 5 + - *
3 5 6 * + 7 8 5 + * -
The difference between a binary tree and a binary search tree is that ,a binary search tree has
two children per node whereas a binary tree can have none, one, or two children per node
in binary search tree nodes are inserted based on the values they contain
in binary tree nodes are inserted based on the values they contain
none of these
We can add elements in QUEUE From _______________
Front
Rear
From Both Rare and Front
None of these
Which of the following abstract data types are NOT used by Integer Abstract Data type group?
short
Int
float
long
Which one of the following statements is correct?
Array size is fixed once it is created
Link List size is fixed once it is created
Binary Search Tree size is?fixed once it is created
AVL Tree size is fixed once it is created
Linked lists are collections of data items "lined up in a row" , insertions and deletions can be made only at the front and the back of a linked list.
TRUE
FALSE
In a program a reference variable, say x, can be declared as
int &x ;
int *x ;
int x ;
None of the given options
Which one of the following statement is NOT correct .
In linked list the elements are necessarily to be contiguous
In linked list the elements may locate at far positions in the memory
In linked list each element also has the address of the element next to it
In an array the elements are contiguous
Is a data structure that can grow easily dynamically at run time without having to copy existing elements?
Array
List
Both of these
None of these
Queue follows
Last in First out
First in Last out
First in First out
None of these
Parameters in function call are passed using,
Stack
Queue
Binary Search Tree
AVL Tree
Which statement of the following statements is incorrect?
Lists can be implemented by using arrays or linked lists
A list is a sequence of one or more data items
Stack is a special kind of list in which all insertions and deletions take place at one end
Stacks are easier to implement than lists
The operation for removing an entry from a stack is traditionally called:
delete
peek
pop
remove
Suppose a pointer has been declared in main but has not assigned any variable address then
That pointer points to First byte in main function
That pointer contains a NULL value
That pointer points to any memory address
?None of these
A Compound Data Structure is the data structure which can have multiple data items of same type or of different types.Which of the following can be considered compound data structure?
Arrays
LinkLists
Binary Search Trees
All of the given options
The tree data structure is a
Linear data structure
Non-linear data structure
Graphical data structure
Data structure like queue
Which one of the following is a valid postfix expression?
ab+c*d-
abc*+d-
abc+*d-
(abc*)+d-
When an operator is used in between two operands this is which type of notation
Prefix
Postfix
Infix
None of the Above
What will be the valid postfix notation of A+B*C-D
ABC+*D-
ABC*+D-
ABCD+-*
AB+D*C
Tree data structure is a
Linear
Non Linear
Circular
None of Above
Non recursive calls are faster than the Recursive calls.
TRUE
FALSE
Following are the linear data structures:-
Stacks
Queues
Both Stacks and Queues
None of the above
Highest Operators Precedence is of the following operator:-
Plus
Minus
Multiply
Exponentiation
Each node in a BST has Pointers:-
1
2
3
4
After creation of an array:-
Size can be increase but can not be decreased.
Size can be decreased but can not be increased.
Size can neither be increased nor be decreased.
Size can be increased and can also be decreased
BST is a Structure:-
Linear
Non Linear
Circular
None of Above
To check the depth of an AVL tree following time will be taken:-
1.66 Log2n
1.44 Log2n
Log2 (n+1)-1
1.66 Log2n (n+1)
In an AVL tree to delete a parent with two childs in a straight line following rotations will be required
Single
Double
Triple
None.of the given options
Which of the following is a non linear data structure?
Linked List
Stack
Queue
Tree
Consider the following infix expression. 5 + 6/2 If one converts the above expression into postfix, what would be the resultant expression?
56/ + 2
5 6 2 / +
/62 + 5
5 6 / 2 +
There is/are case/s for rotation in an AVL tree,
1
2
3
4
Searching an element in an AVL tree take maximum in AVL tree,
Log2(n+1) time (where n is no. of nodes
Log2(n+1) -1
1.44 Log2n
1.66 Log2n
Which of the following is "TRUE" about arrays,
We can increase the size of arrays after their creation.
We can decrease the size of arrays after their creation.
We can increase but can't decrease the size of arrays after their creation.
We can neither increase nor decrease the array size after their creation.
Four statements about trees are below. Three of them are correct. Which one is INCORRECT?
Trees are recursively defined multi-dimensional data structures tree
The order of a tree indicates a maximum number of children allowed at each node of the
A search tree is a special type of tree where all values (i.e. keys) are ordered
If Tree1's size is greater than Tree2's size, then the height of Tree1 must also be greater than Tree2's height.
Which one of the following operators has higher priority than all of others?
Multiplication operator
Minus operator
Plus operator
Exponentiation operator
A queue is a_______________ data structure, whereas a stack is a -----data structure.
FIFO, LIFO 
LIFO,FIFO
both given options
None of these
Suppose that the class declaration of SomeClass includes the following function prototype. bool LessThan( SomeClass anotherObject ); Which of the following tests in the client code correctly compares two class objects alpha and beta?
if (alpha < beta)
if (alpha.LessThan(beta))
if (LessThan(alpha, beta))
if (LessThan(alpha).beta)
Which one of the following statements is NOT correct?
Array size can be changed after its creation.
Link List size can be changed after its creation
Binary Search Tree size can be changed after its creation
AVL Tree size can be changed after its creation
Which one of the following calling methods does not change the original value of the argument in the calling function?
None of the given options
Call by passing the value of the argument
Call by passing reference of the argument
Call by passing the address of the argument
In an array list the current element is
The first element
The middle element
The last element
The element where the current pointer points to
In an array we can store data elements of different types.
TRUE
FALSE
The following are statements related to queues. (i) The last item to be added to a queue is the first item to be removed (ii) A queue is a structure in which both ends are not used (iii) The last element hasn’t to wait until all elements preceding it on the queue are removed (iv)A queue is said to be a last-in-first-out list or LIFO data structure.

Which of the above is/are related to normal queues?

(iii) and (ii) only
(i), (ii) and (iv) only
(ii) and (iv) only
None of the given options
Which of the following can be used to reverse a string value,
Stack
Queue
Both of these
None of these
_______________ is the maximum number of nodes that you can have on a stack-linked list ?
Zero
2n (where n is the number of nodes in linked list)
Any Number
None of these
Consider the following sequence of push operations in a stack: stack.push(’7’); stack.push(’8’); stack.push(’9’); stack.push(’10’); stack.push(’11’); stack.push(’12’);
7 8 9 10 11 12
9 8 11 10 7 12
9 10 8 11 12 7
9 10 8 12 7 11
The operation for adding an entry to a stack is traditionally called :
add
append
insert
push
In C what is the operation that you can not do with primitive types?
Assign a value to primitive type using a literal
Declare primitive types to be constant using the Const keyword
Create a new instance of primitive type with New keyword
None of these


Lecture-wise Quiz Tests