Basic Tree Data Structure Concepts
18 Questions
0 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the root node in a tree hierarchy?

  • The node with the most children
  • The node with the most ancestors
  • The node with no parent (correct)
  • The node at the lowest level

Which nodes can be considered as sub-trees of the root node?

  • All nodes except the root node
  • Only the leaf nodes
  • T1, T2, and T3 (correct)
  • Only the nodes at level 1

What is the degree of a leaf node?

  • 1
  • 2
  • 0 (correct)
  • Equal to the number of ancestors

What is the level number of the root node in a tree?

<p>0 (B)</p> Signup and view all the answers

What is the path to the node E in the given image?

<p>A → B → E (A)</p> Signup and view all the answers

What is an ancestor of a node in a tree?

<p>Any predecessor node on a path from the root to that node (A)</p> Signup and view all the answers

What is the primary advantage of a Linked List over an array?

<p>Dynamicity and ease of insertions and deletions (C)</p> Signup and view all the answers

What is a node in a Linked List?

<p>A separate object with a data part and address part (B)</p> Signup and view all the answers

What is a disadvantage of a Linked List?

<p>The nodes cannot be accessed directly (B)</p> Signup and view all the answers

In which package is the Linked List class located?

<p>java.util (A)</p> Signup and view all the answers

What is a characteristic of a Linked List?

<p>Elements are stored in non-contiguous memory locations (B)</p> Signup and view all the answers

What is the relationship between elements in a Linked List?

<p>Elements are linked using pointers and addresses (D)</p> Signup and view all the answers

What is the primary function of the address field in a Singly Linked List node?

<p>To contain the reference of the next node (C)</p> Signup and view all the answers

Which type of linked list allows traversal in both forward and backward directions?

<p>Doubly Linked List (A)</p> Signup and view all the answers

What is the characteristic of the last node in a Doubly Linked List?

<p>Its next link points to NULL (B)</p> Signup and view all the answers

What is the key feature of a Circular Linked List?

<p>The last node points to the first node (C)</p> Signup and view all the answers

What is a node in a linked list composed of?

<p>A data part and a next part (B)</p> Signup and view all the answers

What is the primary difference between a Singly Linked List and a Doubly Linked List?

<p>Number of links in each node (B)</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser