adplus-dvertising

Welcome to the Trees MCQs Page

Dive deep into the fascinating world of Trees with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Trees, a crucial aspect of Data Structures and Algorithms. In this section, you will encounter a diverse range of MCQs that cover various aspects of Trees, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Data Structures and Algorithms.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Trees. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Data Structures and Algorithms.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Trees. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Trees MCQs | Page 28 of 32

Q271.
Given the pseudo code, state whether the function for merging of two heap is correct or not?
mergeTree(p,q)
      if p.root.value <= q.root.value
         return p.addTree(q)
      else
         return q.addTree(p)
Discuss
Answer: (a).True
Q272.
What is order of resultant heap after merging two tree of order k?
Discuss
Answer: (b).k+1
Q273.
Time taken in decreasing the node value in a binomial heap is
Discuss
Answer: (c).O(logn)
Q274.
What does this pseudo_code return ?
int myfun(heap_arr[])
 {
  int mini=INF;
  for(int i=0;i<tot_node;i++)
  mini=min(mini,heap_arr)
  return mini;
 }
Discuss
Answer: (c).Root of the heap
Q275.
Which of these operations have same complexities?
Discuss
Answer: (c).Union, Insertion
Q276.
The Statement “Fibonacci heap has better amortized running time in compare to a binomial heap”.
Discuss
Answer: (a).True
Q277.
Given a heap of n nodes.The maximum number of tree for building the heap is.
Discuss
Answer: (a).n
Q278.
Choose the option with function having same complexity for a fibonacci heap.
Discuss
Answer: (a).Insertion, Union
Q279.
What is wrong with the following code of insertion in fibonacci heap.
Choose the correct option
FIB-INSERT(H, x)
 degree[x]= 0
 p[x]=  NIL
 child[x] =NIL
 left[x] =x
 right[x] =x
 mark[x] =FALSE
 concatenate the root list containing x with root list H 
 if min[H] = NIL or key[x] > key[min[H]]
 then min[H]= x
 n[H]= n[H] + 1
Discuss
Answer: (c).Line 9
Q280.
What will be the order of new heap created after union of heap H1 and H2 when created by the following code.Initially both are of the order n.
FIB_UNION(H1,H2)
 {
  H =MAKE_HEAP()
  min[H]= min[H1]
  concatenate the root list of H2 with the root list of H
  if (min[H1] = NIL) or (min[H2]!= NIL and min[H2] < min[H1])
  then min[H] = min[H2]
  n[H]=  n[H1] + n[H2]
  free the objects H1 and H2
  return H
 }
Discuss
Answer: (a).n+1

Suggested Topics

Are you eager to expand your knowledge beyond Data Structures and Algorithms? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!