• Home
  • University of the People
  • Data Structures (proctored course) CS 3303
  • Binary Trees and Traversals

Binary Trees and Traversals

A leaf is any node that: Select one: UNIT 4 - SELF OUIZ a.Has one child b.Is an internal node with no ancestors Is any node with two empty children d.Is the ancestor of the root node The full binary tree theorem states "the number of leaves in an empty full binary tree is one more than the number of internal nodes" ANSWER: FALSE The process for visiting all of the nodes of a binary tree in some order is called a traversal. ANSWER: TRUE A full binary tree has a restricted shape which starts at the root and fills the tree by levels from left to right. ANSWER: FALSE A binary tree traversal that lists every node in the tree exactly once is called: Select one: a.a Traversal b.A visitor design pattern .An enumeration d.Natural ordering sequence A preorder traversal visits every node starting at the leaf nodes and working up the tree. ANSWER: FALSE Correctly identify the following heap structure bv selecting the best answer: Select one: a.partially ordered heap max-heap structure c.priority heap d.min-heap structure Select the answer that best defines Huffman Coding: Select one: a.A set of coding rules that is typically used for compression b.A fixed length coding scheme for character representation c.A tree structure that trades off space and time requirements to provide a more efficient priority queue .An approach of assigning codes to characters such that the frequency length of the code depends upon the relative frequency of the corresponding character in use The depth of node H in the following tree is: Select one: .3 b.2 c.4 d.1 According to textbook by Shaffer, a heap data structure has two properties which are: Select one: a.every node stores a value less than or equal to that of its children and it is a complete binary tree b.it is a min-heap and is partially ordered t is a complete binary tree and the values stored in it are partially ordered d.it is a priority queue and is in O( n ) Bilai Only preorder ABDCEGFHI postorder DBGEHIFCA (every root node ignored first) inorder BDAGECHFI Bilai Only An inorder traversal first visits the left child (including its entire subtree), then visits the node, and finally visits the right child (including its entire subtree) UNIT 5 - SELF OUIZ A finite set of one or more nodes such that there is one designated node call the root is a: (select the best answer) Select one: a.Parent root b.a B+ tree data structure c.Index Tree A collection of one or more trees is called: Select one: a. Trees b.Multiple Spanning Trees .a Forest d. Traversals The process of determining if two objects are in the same set and then merging those sets is called: Select one: a.a Union Operation Union / Find c.a Weighted Union d.a Merge Operation A traversal of a general tree that traverses the roots subtrees from left to right, then visits the root is called a preorder traversal. ANSWER: FALSE A method that