Homechevron_rightEngineeringchevron_rightComputer Sciencechevron_rightData Structurechevron_rightWhich of the following statements is INCORRECT with respect to a binar...

Which of the following statements is INCORRECT with respect to a binar...

  • Q. Which of the following statements is INCORRECT with respect to a binary tree?
  • filter_dramaExplanation
    Answer is : D

    Answer: Option 4

    Concept

    Full Binary Tree

    A full binary tree is a binary tree in which each node has exactly two or 0 children.

    Complete Binary Tree:

    A complete binary tree is a binary tree in which

    1. except last level tree is completely filled.
    2. The last level is filled from left to right.

    Perfect Binary Tree

    A perfect binary tree is a binary tree in which

    1. all interior node or internal nodes has 2 children.
    2. all leaves are at the same level.

    Balanced Binary Tree

    A Balanced Binary tree is a binary tree in which at any node height of the left sub tree and right sub tree do not differ by more than 1.

Discussion

    No one started the discussion yet. Break the ice and start the conversation.
    Please Login to be part of the discussion.

Similar Questions

  • 1. With respect to linked lists and arrays, which of the following statements is INCORRECT?
  • filter_dramaExplanation
    Answer is : A

    Answer Option 1

    Concept

    Array

    Linked Lists ( Singly linked list )

    1. Array supports Random access to its elements.

    1. Linked list does not support Random access to its elements

    2. Array elements are stored in a contiguous manner.

    2.  Linked list elements are generally not stored in contiguous locations.

    3. In Arrays, new elements cannot be added dynamically due to their fixed size.

    3. In Linked Lists, an element can be easily added dynamically as the Linked list can dynamically grow or shrink as when needed

    4. Inserting a new element in an array is expensive compared to inserting a new element in a linked list. Because size is fixed we have to create a new Array entirely and copy all the elements to a new array along with the new element

    4. Inserting a new element in a Linked List is very simple. Just allocate space for the new node and update the references/pointers.

    5. Deleting an element from an array is expensive compared to deleting an element from a linked list. Because suppose we want to delete the very first element from the array then we need to shift all the right elements to one position left.

    5. Deletion in the linked list is simple just deallocate the node and change the references/pointers.

    6. In Arrays there is no extra space/variables is allocated.

    6. In the Linked List, pointers are maintained for every node in order to keep track of all the nodes in the list.

     

    Explanation

    Option 1: The linked list is slower in add and remove, but faster in get.

    This is the only option that is incorrect since Linked list adding and removing the given element is faster as compared to an array but finding a particular indexed element we might have to traverse to entire list but in case of array random access possible.

  • 2. Which of the following statements is INCORRECT with respect to a binary tree?
  • filter_dramaExplanation
    Answer is : D

    Answer: Option 4

    Concept

    Full Binary Tree

    A full binary tree is a binary tree in which each node has exactly two or 0 children.

    Complete Binary Tree:

    A complete binary tree is a binary tree in which

    1. except last level tree is completely filled.
    2. The last level is filled from left to right.

    Perfect Binary Tree

    A perfect binary tree is a binary tree in which

    1. all interior node or internal nodes has 2 children.
    2. all leaves are at the same level.

    Balanced Binary Tree

    A Balanced Binary tree is a binary tree in which at any node height of the left sub tree and right sub tree do not differ by more than 1.

  • 3. In binary search tree which traversal is used for getting ascending order values?
  • filter_dramaExplanation
    Answer is : A

    Concept:

    By the definition of a Binary Search Tree (BST), the value of left child node <= root node < right child node or left child node < root node <= right child node.

    In inorder traversal, we visit left node first, then root node and then right node. Hence, the inorder traversal always returns values in ascending order if it is run on a Binary Search Tree.

    Explanation:

    Binary Search Tree:

    Apply Inorder Traversal

    This will print 1-2-3.

    This will print 1-2-3-4 and then 1-2-3-4-5-6-7

    Output of Traversal: 1-2-3-4-5-6-7 (sorted order)

    Important Points:

    There are usually three methods of traversing a BST - Preorder, Postorder, Inorder.

    • In preorder, we visit nodes in the order of Root -> Left -> Right
    • In postorder, we visit nodes in the order of Left -> Right -> Root
    • In inorder, we visit nodes in the order of Left -> Root -> Right
  • 4. In a circularly linked list organization, insertion of a record involves the modification of 
  • filter_dramaExplanation
    Answer is : C

    Circular linked list:
    In singly linked lists and doubly linked lists, the end of lists is indicated with a NULL value. But circular linked lists do not have ends. In circular linked lists, each node has a successor, and the last node points to the first node instead of NULL.

    Example

    Let x be a variable pointer and head.

    Head is the pointer of the circular linked list.

    Now to insert a new record (node) y, we have to loop through the linked list from the head to the last node like this pseudocode below.

    x=head

    while(x->next!=head)

    {

       x=x->next;

    }

    After finishing the loop x is now the last node and we will append the list. y is the next node of x Then the next of y will have to point to the head since the linked list is circular. The pseudocode for this task is below.

    x->next=y;

    y->next=head; 

    So There needs modification of two pointers

    So the correct answer is Option 3

  • 5.

    The for statement 

    for(expr; expr; expr3) is equivalent to

  • filter_dramaExplanation
    Answer is : C

    While loop:

    In the while loop, the expression is evaluated.  If it is non-zero, the statement is executed and the expression is re-evaluated. This cycle continues until expression becomes zero, at which point execution resumes after the statement. 

    For loop:

    In the case of for loop, expris an assignment or function call, expr2 is a relational expression while expr3 is also an assignment or function call. The for loop basically assigns the value to a variable using expr1, expr2 is used to evaluate the expression, and expris used to modify the value of expr2 so that the terminating condition is reached.

    This functionality can be achieved using the while statement as listed in option 3.

Data StructureTopics

leaderboardLeaderboard
  • Rahul Kumar

    191 Points

  • VIKRAM JEET

    54 Points

  • GEETHIKA CHOWDARY

    53 Points

  • sunita saini

    52 Points

  • Zain

    49 Points