CS301 Data Structure Online Solved MCQ's Quizzes File 6



 Vukwl- Virtual Education Solution

Heap can be use to implement
Stack
Link list
Queue
Priority Queue

The preculateDown procedure will move the smaller value____ and bigger value______.
Select correct option:
left,right
right,left
up,down
down,up 
Which one of the following is not true regarding skip list.
Each list Si contain the special key + infinity and –infinity
List SO contain the key of S is non-decreasing order
List Sh contain only the n special keys

Each list in a sub sequence of previous list one
If Ahmad is cousin of Ali and Ali is cousin of Asad then Ahmad is also cousin of Asad the statement has the following property.
Reflexivity
Symmetry
Transitivity
All of the above

The function has logical problem, therefore, it will not work properly. 
 The function will be compiled but will throw runtime exception immediately after the control is transferred to this function. 
 
Question No: 22      ( M - 1 ) . 
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.
 
Question No: 23      ( M - 1 ) .
Which of the following statement is NOT correct about find operation:  
   It is not a requirement that a find operation returns any specific name, just that finds on two elements return the same answer if and only if they are in the same set. 
One idea might be to use a tree to represent each set, since each element in a tree has the same root, thus the root can be used to name the set.
 Initially each set contains one element. 
 Initially each set contains one element and it does not make sense to make a tree of one node only. 
 
Question No: 24      ( M - 1 ) 
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
 
Question No: 25      ( M - 1 ) . 
Here is an array of ten integers:
            5   3   8   9   1   7   0   2   6   4
The  array after the FIRST iteration of the large loop in a selection sort (sorting from smallest to largest).
0   3    8    9    1     7     5     2     6    4
2     6    4    0   3    8    9    1     7     5  
2     6    4    9    1     7     0   3    8    5  
0   3    8     2     6    4    9    1     7       5
 
Question No: 26      ( M - 1 ) .
What requirement is placed on an array, so that binary search may be used to locate an entry? 
The array elements must form a heap.
The array must have at least 2 entries.
The array must be sorted.
The array’s size must be a power of two.
 
Question No: 27      ( M - 2 )
Give one example of Hashing
 
Question No: 28      ( M - 2 )
How heap sort works to sort a set of data.
 
Question No: 29      ( M - 2 )
How we can implement Table ADT using Linked List
  
Question No: 30      ( M - 2 )
If we allow assignment to constants what will happen?
 
Question No: 31      ( M - 3 )
Explain the process of Deletion in a Min-Heap 
 Question No: 32      ( M - 3 )
Give any three characteristics of
Union by Weight method.
 Question No: 33      ( M - 3 )
"For smaller lists, linear insertion sort performs well, but for larger lists, quick sort is suitable to apply." Justify why?

Question No: 34      ( M - 5 )
Write down the C++ code to implement Insertion Sort Algorithm. 

 Vukwl- Virtual Education Solution

The expression of (! heap-> is full() ) check
Heap is empty
Heap is full
Heap is not empty
Heap is not full(not conferm)
Which one of the following is not the property of equivalence relation
Reflexive
Symmetric
Transitive
Associative
Which of the following is not and implementation of table ADT
Sorted sequentially array
Stack
Link list

Skip list 

Which one of the following is not an open addressing technique to resolve collection

Quadratic probing
Double hashing

Cubic probing
Liner probing





Local variables of a function are stored in, 
Select correct option: 
 Binary Search Tree 
 Stack
 Queue 
 AVL Tree
     
Compiler uses which one of the following in Function calls, 
Select correct option: 
 Stack 
 Queue 
 Binary Search Tree
 AVL Tree
   

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
   

Which data structure allows deleting data elements from front and inserting at rear? 
Select correct option: 
 Stacks 
 Queues 
 Deques 
 Binary search tree
   

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
   

What will be postfix expression of the following infix expression? Infix Expression : a+b*c-d 
Select correct option: 
 ab+c*d-
 abc*+d-
 abcd+*-
 abc+*d-
   

A class has ________ destructor
·       One
·       Two
·       Three
·        
·       Bahaviors of a type of objects are represented through
·       States
·       Attributes
·       Operations
·        
·       Which is not an example of multiple inheritances?
·       Mermaid
·       Amphibious Vehicle


·       Car
·       None of the above
·        
·       Static data members are called ____________ variable
·       Class
·       Object
·       Structure
·       None of the given
·        
·       Associatively can be change in operator overloading.
·       True
·       False

Which of the following is NOT a linear data structure? 
Select correct option: 
 Linked List
 Stack
 Queue
 Tree

The next field in the last node in a singly-linked list is set to_______. 
Select correct option: 
 0
 1
 NULL
 false
   

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

 binary

Two entries with the exact same key have different hash values.
 
Question No: 19      ( M - 1 ) .
Suppose that a selection sort of 100 items has completed 42 iterations of the main loop. How many items are now guaranteed to be in their final spot (never to be moved again)? 
21
41
42
43
 
Question No: 20      ( M - 1 ) .
Suppose you implement a Min heap (with the smallest element on top) in an array. Consider the different arrays below; determine the one that cannot possibly be a heap:                 
16, 18, 20, 22, 24, 28, 30  
16, 20, 18, 24, 22, 30, 28
16, 24, 18, 28, 30, 20, 22
16, 24, 20, 30, 28, 18, 22
 
Question No: 21      ( M - 1 ) .
Do you see any problem in the code of nextInOrder below:
 TreeNode * nextInorder(TreeNode * p)
{
   if(p->RTH == thread)
     return( p->R );
   else {
     p = p->R;
   while(p->LTH == child)
  p = p->R;
   return p;
   }
 The function has no problem and will fulfill the purpose successfully. 
 The function cannot be compile as it has syntax error. 


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   next to it 
       ► In an array the elements are contiguous 


We can choose any arbitrary name for a constructor.
Select correct option:
True
·       False
·        
·       Which one is not the main feature of object oriented programming?
Select correct option:
Classes and Objects
Exception handling
Inheritance
Polymorphism 
·       The dot operator (or class member access operator) connects the following two entities (reading from left to right):
Select correct option:
A class member and a class object
A class object and a class
A class and a member of that class
A class object and a member of that class 
·       If only one behaviour of a derived class is incompatible with base class, then it is:
Select correct option:
Generalization
Specialization
Extension 
Inheritance
·       Storing data and functions in a single unit (class). Data cannot be accessible to the outside world and only those functions which are stored in the class can access it
Select correct option:
Inheritance
Abstraction
Polymorphism
Encapsulation 

Question No: 2      ( M - 1 ) .

Each operator in a postfix expression refers to the previous ________ operand(s).
       ► One
       ► Two
       ► Three
       ► Four

p67
Question No: 3      ( M - 1 ) .

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

Question No: 4      ( M - 1 ) - Please choose one

  A tree is an AVL tree if 
       ► 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

Question No: 5      ( M - 1 ) .

Suppose currentNode refers to a node in a linked list (using the Node class with member variables called data and nextNode). What statement changes currentNode so that it refers to the next node?
       ► currentNode ++;
       ► currentNode = nextNode;
       ► currentNode += nextNode;
       ► currentNode = currentNode->nextNode;

Question No: 6      ( M - 1 ) .

A queue where the de-queue operation depends not on FIFO, is called a priority queue 
       ► False
       ► True

p101
Question No: 7      ( M - 1 ) .

Which one is a self-referential data type?                                                                    
       ► Stack
       ► Queue
       ► Link list
       ► All of these

Question No: 8      ( M - 1 ) .

Each node in doubly link list has,
       ► 1 pointer
       ► 2 pointers


       ► 3 pointers
       ► 4 pointers

p39
Question No: 9      ( M - 1 ) .

I have implemented the queue with a linked list, keeping track of a front pointer and a rear pointer. Which of these pointers will change during an insertion into an EMPTY queue?
       ► Neither changes
       ► Only front pointer changes.
       ► Only rear pointer changes.
       ► Both change.
Question No: 10      ( M - 1 ) .

Consider the following tree.
How many of the nodes have at least one sibling?
       ► 8
       ► 7
       ► 5
       ► 6

Question No: 9    ( M - 1 )    .
The operation for removing an entry from a stack is traditionally called:     
► delete
► peek
► pop
► remove

Question No: 11      ( M - 1 ) .

The nodes with no successor are called _________
       ► Root Nodes
       ► Leaf Nodes  
       ► Both of these
       ► None of these

Question No: 12      ( M - 1 ) .

AVL Tree is,
       ► Non Linear data structure
       ► Linear data structure
       ► Hybrid data structure (Mixture of Linear and Non Linear)
       ► None of the given options.

Question No: 13      ( M - 1 ) .

We access elements in AVL Tree in,
       ► Linear way only
       ► Non Linear way only
       ► Both linear and non linear ways
       ► None of the given options.

Question No: 14      ( M - 1 ) .

A binary search tree should have minimum ofone________ node/s at each level,
       ► One  ( not sure )
       ► Two
       ► Three
       ► Four

The sentence “Object Oriented Programming book in bookshelf” is an example of:
·       Association
·       Multiple associations
·       Aggregation
·        
·        
·       How the information hidden within an object can be accessed?
·       Through its interface
·       Through its private data member
·       Through its private member functions
·        
·        
·       There is no need to is or is a kind of relationship in generalization
·       True
·       False
·        
·       An object has _______ interface(s)
·       Only one
·       Only two
·       One or more than one


·        
·       Which of the following is an advantage of OOP?
·       It provides an ability to create one user defined data type extending the other
·       It provides the facility of defining abstract data type through which real entities can be defined better
·       All of the given option
·        
·       Encapsulation means
Select correct option:

Extending the behaviour of class in another class
Data and behaviour are tightly coupled within an entity 
One entity takes all the attributes and operations of the other
Taking out the common features and put those in a separate class 
·       We can allocate dynamic memory allocation through___________ key word.
Select correct option:
Static
Global
New 
Const
Question No: 15      ( M - 1 ) .

Consider the following statements.
  1. A binary tree can contain at least 2LNodes at level L.
  2. A complete binary tree of depth d is a binary tree that contains 2LNodes at each level L between 0 and d, both inclusive.
  3. The total number of nodes (Tn) in a complete binary tree of depth d is 2 d+1- 1 .
  4. The height of the complete binary tree can be written as h = log 2(Tn+1)-1 where Tnis Total number of Nodes.
Which one of the following is correct in respect of the above statements regarding the Binary trees?
       ► (i) and (iii) only
       ► (i), (ii) and (iii) only
       ► (ii) and (iii) only
       ► (ii), (iii) and (iv) only

Question No: 16      ( M - 1 ) .

“+” is a _________operator.
       ► Unary
       ► Binary
       ► Ternary
       ► None of the above

Question No: 17      ( M - 2 )

What would the state of a stack be after the following operations?
create stack
push A onto stack
push F onto stack
push X onto stack
pop item from stack
push B onto stack
pop item from stack
pop item from stack

Question No: 1      ( M - 1 ) .
 A queue where the de-queue operation depends not on FIFO, is called a priority queue 
       ► False
       ► True

Question No: 2      ( M - 1 ) .
 The data of the problem is of 2GB and the hard disk is of 1GB capacity, to solve this problem we should 
       ►  Use better data structures
       ► Increase the hard disk space 
       ► Use the better algorithm 
       ►  Use as much data as we can store on the hard disk 


While building Huffman encoding tree the new node that is the result of joining two nodes has the frequency.
► Equal to the small frequency
► Equal to the greater
► Equal to the sum of the two frequencies
► Equal to the difference of the two frequencies

Question No: 3      ( M - 1 ) .

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) ; 
       ► a = X (&b) ;
       ► a = X (*b) ; 
       ► None of the given options

Question No: 4      ( M - 1 ) - Please choose  one

In the call by value methodology, a copy of the object is passed to the called function. 
       ► False
       ► True

Question No: 5      ( M - 1 ) .

The tree data structure is a 
       ► Linear data structure
       ► Non-linear data structure
       ► Graphical data structure
       ► Data structure like queue

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

If MyClass has a destructor what is the destructor named?
Select correct option:
MyClass
~MyClass
My~Class
MyClass~
·       A real world object can be transformed into programming entity by defining its respective
Select correct option:
ClassFunction
Only states
Only behaviour

Which of the following features of OOP is used to deal with only relevant details?
Select correct option:
Abstraction
Information hiding
Object
Inheritance

In class, attributes and behaviour is represented by:
Select correct option:
Member functions, data members
Member functions, scope of data members
Data members, member functions
None of the given
·       Using encapsulation we can achieve
Select correct option:
Information hiding
Least interdependencies among modules
Implementation independence
All of given options

cs301 mcqs solved cs301 quiz mega file cs301 midterm solved papers 2017 cs301 solved mcqs mega file cs301 midterm solved papers 2016 cs301 data structures midterm papers cs301 final term solved mcqs mega file cs301 handouts cs301 lectures cs301 assignment cs301 handouts cs301 assignment solution 2018 cs301 ppt slides cs301 assignment no 2 solution 2018 cs301 midterm solved papers by moaaz cs301 final term solved mcqs by moaaz

Post a Comment

Previous Post Next Post