Ch. 8 Trees

¡Supera tus tareas y exámenes ahora con Quizwiz!

There are three different types of binary trees: ____ binary tree: Every node other than leaf nodes has 2 child nodes. _____ binary tree: All levels are filled except possibly the last one, and all nodes are filled in as far left as possible. _____ binary tree: All nodes have two children and all leaves are at the same level.

1. full 2. complete 3. perfect

Strength, Weakness & Application of B-Tree

B-Tree is useful while working with a large amount of data and useful in designing high-level frameworks. Since the leaf and non-leaf nodes are of different sizes, data storage is complicated. B-Trees are used extensively in creating databases.The framework for the Ruby-on-Rails application uses B-Trees for database indexing.

In ____ Trees, each parent can have more than two child nodes. The concept can be thought of as a computer file system where parent nodes (directories) can have more than one child node (files). An important feature is that there are self-balancing, and they help in improving the performance of the application in use

B-Trees

____ _____ are the most efficient when it comes to inserting and searching data. They are called binary because each node is a parent with only two children attached to it

Binary Trees

Application for Syntax Tree

Constructed by software compilers and calculators to parse expressions.

What is the main characteristic of binary trees? Each parent only has two children. Search time can be reduced. Each root only has two nodes. Each node is connected twice.

Each parent only has two children. Explanation Binary trees are called that because each node can only have two children.

Which major application uses B-tree data structure? Priority Queuing Database building and indexing Writing routing algorithms Designing heap sort algorithm

Explanation B-tree is used majorly in building a database and its indexing.

Huffman code binary trees are used in which of the following? Image and video compression Cryptography 3D video games Job scheduling queues

Explanation Huffman code binary trees are generally used in image and video compression algorithms, such as those used by the .jpeg and .mp3 file formats.

____ is a specialized data structure which satisfies the criteria that the value of the parent node should be either greater than or equal to the value of child node (max ____) or less than the value of the child node (min ____)

Heap

What determines if a value being stored in a tree needs to go to the right or to the left side of the root? If the value being stored is less or greater than the value in the root. If there is an existent root in the tree or not. If the tree being used is a binary tree or not. If all the children in the tree are in the same level.

If the value being stored is less or greater than the value in the root. Explanation Trees store data according to the root value. If the item inserted is less, it should go to the left, otherwise it should go to the right.

Strength, Weakness & Application of Heap

Since the highest and lowest priority element is placed at the root node, heaps are very useful in a data structure that requires an element to be removed with highest or lowest priority. Data storage on the heap is slower and comparison takes more time than other data structures. Heaps are used by developers to build priority queues, where each element is given a priority.Heaps are used in one of the best sorting algorithms called heapsort algorithm.

Strength, Weakness & Application of Binary Search Tree

The strength of a binary tree is that it quickly filters out unnecessary data while performing various operations. Binary trees are only efficient when the tree is balanced. If the tree is unbalanced, it won't provide same benefits. Binary tree is used in implementing expression solvers and expression parsers.It is used in high-bandwidth routers for storing routing tables.

Application for GGM trees

Used by cryptographic applications to generate a tree of pseudo-random numbers.

Application for Binary trees

Used by high-bandwidth routers for storing router tables.

Application for Hash trees

Used by peer-to-peer programs and specialized image-signatures.

Application for Huffman coding tree

Used for image and video compression algorithms, such as those used by .jpeg and .mp3 file formats.

Application for Binary space partition

Used in 3D video games to determine what objects need to be rendered.

Application for Heaps

Used to implement priority scheduling queues in many operating systems, quality-of-service (QoS) in routers, and path-finding algorithms used in AI applications (including robotics and video games).

Application for Binary search tree

Used to search applications where data is continuously entering and leaving.

In an ______ traversal, we first visit the left child (including its entire subtree), then visit the parent node and finally visit the right child (including its entire subtree). Here, we begin at the left-most node (node 0) and end at the right-most node (node 10). The traversal sequence, in this case, would be: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

inorder traversal

What type of structure uses data stored inside a tree node? Key-value Hash-map Hash-code Primary key

key-value Explanation The nodes in trees store information in key-value structures.

In a ______ traversal, we visit each node only after we visit its children (and their subtrees). We begin with the left-most node (node 0) and end with the root (node 7). The traversal sequence, in this case, would be: 0, 2, 4, 6, 5, 3, 1, 8, 10, 9, 7

postorder traversal

In _______ transversal, we visit any given node before we visit its children. Here, we begin at the root (node 7) and end at the right-most node (node 10). The traversal sequence, in this case, would be: 7, 1, 0, 3, 2, 5, 4, 6, 9, 8, 10

preorder traversal

An important use of heap data structure is _____. building databases storing routing tables priority queue indexing databases

priority queue Explanation Since heaps are very useful in the data structures that require an element to be removed with highest or lowest priority, one of its major application areas is designing priority queues.

Both inserting and searching operations start with the ____ node and ask if the value to be searched or inserted is more or less than the value contained by the root

root


Conjuntos de estudio relacionados

Ch. 10 GI Tract & Abdominal Wall

View Set

Simplifying by CLT and Distributive Property

View Set

Finanzas 1er parcial HENM 4to año LOGISTICA

View Set

Common Tableau Interview Questions

View Set

spanish : daily routine vocabulary

View Set

Med Surg Chapter 20 Coordinating care for patients w/immune disorders

View Set

D076 Finance Skills for Managers - Unit 3

View Set

PH Chapter 24 - Adrenergic Drugs

View Set

English Test 1- Assignments & Topic Review

View Set

Business Law Exam II: Chapter 9 Questions and Essays

View Set