SUPERSTARWEBTECH

There is no elevator to success. You have to take the stairs. Take your first steps with SSWT!

CS301-Data Structures Quiz MCQs Lecture 1-22 Midterm Objective Questions

CS301-Data Structures Quiz  MCQS #Objective #Questions #Midterm

1. In case of insertion of a right outer node in BST.

  • we apply single left rotation to make it AVL tree
  • we apply single right rotation to make it AVL tree
  • we apply single left rotation first and then right rotation to make it AVL tree
  • we apply single right rotation first and then left rotation to make it AVL tree

2. Which one is the correct function call for the following function of calculation cube?
int cube(int& num)
{
.
.
.

  • cube(&num)
  • cube(&&num)
  • cube(*num)
  • cube(num)

3. A tree is an AVL tree if

  •  Anyone node fulfills the AVL condition
  • At least half of the nodes fulfill the AVL condition
  • All the nodes fulfill the AVL condition
  • None

4. During in-order traversal using recursive calls, if we found a node is NULL. It means this node will satisfy the following condition.

  • It will not have left child
  • It will not have the right child
  • It will not have both left and right children
  • None

5. A parse tree should be a/an

  • AVL tree
  • Heap
  • Binary Search Tree
  • Complete Binary Search Tree

6. Binary Search Tree violates the condition of AVL tree when any node has a balance equal to

  • 2 or -2
  • 1 or -1
  • 0
  • None

7. Suppose there is a BST with elements, 13,3,14,1,4,18 and 2. Now if the method insert (4) is called, which message will be displayed?

  • Node is inserted in the root
  • Node is inserted in the left subtree
  • Node is inserted in the right subtree
  • Node already exists in the tree

8. Which data structure allows deleting data elements from front and inserting at the rear?

  • Stacks
  • Queues
  • Deques
  •  Binary search tree

9. In which of the following function signatures, the value of variable “num” can not be changed in a function body?

  • int cube(int num)
  • int cube(int& num)
  • int cube(const int& num)
  • int cube(int* num)

10. In-order traversal method traverses the data in

  • Non-sorted order
  • Random order
  • Sorted order
  • None

Author

Anam Afzal

Anam Afzal

Hi, I'm a Pakistani freelancer with a passion for helping businesses achieve their online goals through no-code solutions. I specialize in WordPress customization and ManyChat automation, and I'm always on the lookout for new ways to use technology to make businesses more efficient and successful. I'm also a big believer in the power of no-code tools to democratize technology and make it accessible to everyone. I'm passionate about sharing my knowledge and helping others learn how to use no-code tools to create their own websites, automate their workflows, and grow their businesses. If you're looking for a reliable and experienced no-code developer, I'm here to help. Please feel free to contact me to discuss your project requirements.
SHARE THIS POST