Menu

Question Discussion & Solution

MCQ
Q.
Select the code snippet which performs in-order traversal.

a)

public void inorder(Tree root)
{
 System.out.println(root.data);
 inorder(root.left);
 inorder(root.right);
}

b)

public void inorder(Tree root)
{
 inorder(root.left);
 System.out.println(root.data);
 inorder(root.right);
}

c)

public void inorder(Tree root)
{
 System.out.println(root.data);
 inorder(root.right);
 inorder(root.left);
}

d) None of the mentioned

forum Community Discussion

speaker_notes_off

No discussions yet. Be the first to start!

You must be logged in to participate in the discussion.

login Login to Discuss

auto_awesome Similar Questions

MCQ
1.
Let T be a tree with 10 vertices. The sum of the degrees of all the vertices in T is _____.
forum Discussion
MCQ
2.
What is the space complexity of the in-order traversal in the recursive fashion? (d is the tree depth and n is the number of nodes)
forum Discussion
MCQ
3.
How is a bit vector better compared to a normal array for implementing the hash table?
forum Discussion
MCQ
4.
How can you save memory when storing color information in Red-Black tree?
forum Discussion
MCQ
5.
Which of the below statements are true: i.Cartesian tree is not a height balanced tree ii.Cartesian tree of a sequence of unique numbers can be unique generated
forum Discussion

category More Data Structure Topics

article

Data Structure Basics

format_list_bulleted 128 MCQs
article

Abstract data types

format_list_bulleted 37 MCQs
article

Arrays

format_list_bulleted 134 MCQs
article

Lists

format_list_bulleted 166 MCQs
article

Stacks

format_list_bulleted 165 MCQs
article

Queues

format_list_bulleted 61 MCQs
article

Trees

format_list_bulleted 133 MCQs
article

Binary Trees

format_list_bulleted 120 MCQs
article

B Trees

format_list_bulleted 8 MCQs
article

Heaps

format_list_bulleted 36 MCQs
article

Hash based structures

format_list_bulleted 7 MCQs
article

Graphs

format_list_bulleted 157 MCQs
article

Mixed

format_list_bulleted 10 MCQs