Question

QUESTION 1 In a tree, a ____ is a node with successor nodes. root child descendent...

QUESTION 1

  1. In a tree, a ____ is a node with successor nodes.

    root

    child

    descendent

    parent

    sibling

QUESTION 2

  1. In a tree, the ____ is a measure of the distance from a node to the root.

    count

    degree

    branch

    height

    level

QUESTION 3

  1. Which of the following is not a characteristic of a binary search tree?

    Each node has zero, one, or two successors.

    The preorder traversal processes the node first, then the left subtree, and then the right subtree.

    There are only six possible tree traversals.

    Data are processed in key sequence when the tree is traversed using an inorder traversal.

    The key of all nodes on the left subtree are greater than or equal to the key of the node.

QUESTION 4

  1. Which of the following is not a characteristic of a general linear list?

    Insertions and deletions can be done anywhere in the list.

    An empty linear list is identified by a null link pointer.

    A linked list must always have a head pointer.

    For programming efficiency, a linked list may have a last-node pointer.

    One basic operation required to maintain a linear list is a search.

QUESTION 5

  1. Which of the following is not a step in inserting a node in a stack?

    Allocate memory for the new node.

    Search for the insertion location.

    Update the top pointer.

    Update the stack counter if implemented.

QUESTION 6

  1. Which of the following is not a step in inserting a node into a linear list?

    Allocate memory for the new node.

    Determine the insertion point for the new node.

    Set the new nodes link pointer to NULL.

    Point the new node to its successor.

    Point the predecessor to the new node.

QUESTION 7

  1. Which of the following is not a step in queue deletion?

    Search queue for data to be deleted.

    Pass data from deleted node back to calling function.

    Set front pointer to next item in queue.

    Subtract one from queue counter if implemented.

    If queue empty, set rear pointer to null.

QUESTION 8

  1. Which of the following is not required in general-list insertion?

    Insert into an empty list.

    Insert at the beginning of the list.

    Insert at the end of the list.

    Insert a duplicate key.

    Insert in the middle of the list.

QUESTION 9

  1. Which of the following statements about general-list searches and traversals is false?

    Searches must be done using a sequential search algorithm.

    General list traversals start at the beginning and process each node until the last node has been processed.

    The link field in the current node is used to determine which node is processed next.

    The search algorithm uses a predecessor pointer.

    The end of the search is identified by a null link node.

QUESTION 10

  1. Which of the following statements about graph traversal is false?

    Depth-first traversal of a graph requires a stack or a recursive algorithm.

    The breadth-first traversal of a graph requires a queue.

    A depth-first traversal processes the graph data in key sequence order.

    Because a vertex can have multiple parents, logic is requires to ensure that each vertex is processed only once.

    All traversals start at the first vertex of the graph.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(As per guildelines I am answering first 4 parts only)

Answer 1.

In a tree, Parent is a node with successor nodes.

Answer 2.

In a tree, level is measure of distance from node to root.

Answer 3.

option 1 is true, as a binary can have 0, 1 or 2 children only.

option 2 is true, the inorder traversal follows, root node first, left subtree, right subtree

option 4 is true, inorder travesal gives either increasing or decreasing order always.

option 5 is true, in binary tree , in every left subtree root is always greater or equal to its children.

Hence option 3 is false, we have only three type of tree travesal possible- inorder, preorder and postorder.

Answer 4.

Linear list is dynamic data structure, just like an array we can perform insertion and deletion at any position.

Option 1 is correct, as linear list is similar to array, so insertion and deletion can be done at any position.

option 2 is true, if list is empty it has null reference.

option 3 is true, a linked must have head pointer as a starting reference.

option 5 is true, search operation is performed on linear, it means we need traversal of list to maintain.

option 4 is false, we cannot ask directly for the last node pointer in linked list, it has to be traversed from strating node.

Add a comment
Know the answer?
Add Answer to:
QUESTION 1 In a tree, a ____ is a node with successor nodes. root child descendent...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using the following implementation of Tree class Node   {   public int iData;              // data item (key)   public...

    Using the following implementation of Tree class Node   {   public int iData;              // data item (key)   public double dData;           // data item   public Node leftChild;         // this node's left child   public Node rightChild;        // this node's right child   public void displayNode()      // display ourself      {      System.out.print('{');      System.out.print(iData);      System.out.print(", ");      System.out.print(dData);      System.out.print("} ");      }   }  // end class Node //------------------------------------------------------------------ import java.io.IOException; import java.util.Stack; public class Tree { private Node root; // first node of tree // ------------------------------------------------------------- public Tree() // constructor { root = null; }...

  • A collection of nodes is arranged as a binary search tree ordered on the field INFO which contain...

    A collection of nodes is arranged as a binary search tree ordered on the field INFO which contains distinct positive integers for each of the nodes. In addition to INFO, LLINK and RLINK, each node has three other fields CLASS SUCC and PRED CLASS is an information field containing a single letter that denotes the class to which the node belongs (there being up to 26 classes). The nodes in each class are arranged as a doubly-linked circular list with...

  • QUESTION 8   In the _____ traversal, the root is processed first, before its subtrees. breadth first...

    QUESTION 8   In the _____ traversal, the root is processed first, before its subtrees. breadth first preorder postorder inorder 0.10000 points    QUESTION 9 What kind of traversal does the following algorithm (in pseudo-code) describe? Algorithm traversal (root) if (root is not null)      traversal (leftSubTree)      process (root)      traversal (rightSubTree) end if end traversal breadth first preorder inorder postorder 0.10000 points    QUESTION 10 What kind of traversal does the following algorithm (in pseudo-code)  describe? Algorithm traversal (root) if...

  • A Binary Search Tree is a binary tree where nodes are ordered in the following way:...

    A Binary Search Tree is a binary tree where nodes are ordered in the following way: each node contains one key (also known as data) the keys in the left subtree are less than the key in its parent node the keys in the right subtree are greater than the key in its parent node duplicate keys are not allowed Create a Binary Search Tree inserting the following list of numbers in order from left to right. 10,          6,           4,            8,            18,          15,          21 Please type...

  • Let x be an internal node in a binary search tree and y its successor in...

    Let x be an internal node in a binary search tree and y its successor in the infix tree-traversal (then x.key cannot be maximal). Show that either x.right = null and y.left ≠ null, OR x.right ≠ null and y.left = null. (if provide pseudo-code, use Python)

  • (true/false) All nodes in the right subtree of a node must be smaller in value than...

    (true/false) All nodes in the right subtree of a node must be smaller in value than their parent (true/false) Each node in a binary search tree may contain zero, one, or two children nodes. (true/false) It is possible to recursively process a binary search tree to print all the data in a binary search tree in sorted order. (true/false) The value of a parent must be less than all its children. (true/false) All nodes in the right subtree of a...

  • Need help in the below question. Answer in java Start with the tree.java program (Listing 8.1)...

    Need help in the below question. Answer in java Start with the tree.java program (Listing 8.1) and modify it to create a binary tree from a string of letters (like A, B, and so on) entered by the user. Each letter will be displayed in its own node. Construct the tree so that all the nodes that contain letters are leaves. Parent nodes can contain some non-letter symbol like +. Make sure that every parent node has exactly two children....

  • Question B1 You are given the following Java classes: public class Queue { private static class...

    Question B1 You are given the following Java classes: public class Queue { private static class Node { Object object; Node next; Node () { object = null; next = null; } Node (Object object, Node next) { this.object = object; this.next = next; private Node header; private int size = 0; // size shows the no of elements in queue public Object dequeue () { if (size == 0 ) { return null; else { Object remove_object = header.object;...

  • 2. Write a recursive algorithm which computes the number of nodes in a general tree. 3....

    2. Write a recursive algorithm which computes the number of nodes in a general tree. 3. Show a tree achieving the worst-case running time for algorithm depth. 4. Let T be a tree whose nodes store strings. Give an efficient algorithm that computes and prints, for every node v of T, the string stored at v and the height of the subtree rooted at v. Hin Consider 'decorating' the tree, and add a height field to each node (initialized to...

  • Binary Search Tree Part A: The code attached in this document is a sample code to demonstrate ins...

    Binary Search Tree Part A: The code attached in this document is a sample code to demonstrate insert operation in binary search tree. Please fill in the missing part for the insert method to make the program work. The expected output should be as follows. 20 30 40 50 60 70 80 Part B: Find Lowest Common Ancestor (LCA) of a Binary Search Tree. According to WikiPedia definition , The lowest common ancestor is defined between two nodes v and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT