Data Structures

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

The following sequence depicts the values of a heap in its contiguous sequential representation (where the zeroth index is the first value, the 1st index is the second value etc). What does the heap look like after dequeuing the root node and performing the appropriate algorithm until the max heap is reestablished? (provide your answer in the form of a comma-delimited list of values just like it is shown below). DO NOT INCLUDE SPACES IN YOUR RESPONSE -, 100, 55, 33, 17, 50, 20, 19, 10 Answer:

-, 55 ,50, | 33, 17,10, | 20,19

List the sequence of node values that are printed with the data structure above is traversed using a pre-order traversal. 13 9 | 10 7 6 | 5 2 4 | 1 a. 13, 9, 7, 6, 4, 10, 5, 1, 2 b. 7, 4, 6, 9, 1, 5, 2, 10, 13 c. 2, 1, 5, 10, 4, 6, 7, 9, 13 d. 13, 10, 2, 5, 1, 9, 6, 4, 7

13, 9, 7, 6, 4, 10, 5, 1, 2

Which of the following values are found in leaf nodes within the following heap? -, 90, 80, 70, 25, 75, 65, 55, 20, 19 a.90 b.19 c.20 d.65 e.70 f.55 g.25 h.75 i.80

19,20,65,55,75

List the sequence of node values that are printed when a post order traversal is performed on the data structure above. 13 9 | 10 7 6 | 5 2 4 | 1 a. 7, 9, 4, 6, 13, 5, 1, 10, 2 b. 13, 10, 2, 5, 1, 9, 6, 4, 7 c. 7, 4, 6, 9, 1, 5, 2, 10, 13 d. 2, 10, 1, 5, 13, 6, 4, 9, 7 e. 13, 9, 7, 6, 4, 10, 5, 1, 2 f. 2, 1, 5, 10, 4, 6, 7, 9, 13

7, 4, 6, 9, 1, 5, 2, 10, 13

Which of the following is NOT one of the Java Collections covered in the lesson. a. TreeSet b. LinkedHashSet c. ArrayList d. BTreeList

BTreeList

Which of the following statements are TRUE about Maps in Java? a. All Maps use an underlying Hashtable to store its entries b. Every entry in a Map is a Key/Value pair c. The PUT operation stores a Key/Value pair based on the value supplied

Every entry in a Map is a Key/Value pair

In a tree, it is valid for any node to have more than one parent as long as that node is not the root node. Select one: True False

False

Prodding is a term used to describe the Open Addressing method of searching for open spaces in the hash table. Select one: True False

False

Every recursive function has a Base case and a

General Case

Which of the following statements is true about hashing? a. Hashing allows values to be looked up in logarithmic time. b. Hashing allows values to be looked up in factorial time. c. Hashing allows values to be looked up in constant time. d. Hashing allows values to be looked up in linear time. e. Hashing allows values to be looked up in quadratic time.

Hashing allows values to be looked up in constant time.

Which of the following operations exist for an AVL tree? a. Left Inversion b. Top Extraction c. Right Left Rotation d. Middle Rotation e. Left Rotation

Left Rotation, Right Left Rotation

Which statement is most accurate about the data structure above? 13 9 10 7 6 5 2 4 1 a. it is a complete binary tree b.it is a tree c.it is not a tree d.it is a heap e.it is a binary tree

it is a binary tree

Which of these statements is the most accurate about the data structure above? 13 9 | 10 7 6 | 5 2 1 4 | a. it is a complete binary tree b. it is a tree c. it is a heap d. it is not a tree e. it is a binary tree

it is a heap

Which of the following statements are true about the contiguous sequential representations below? -, 10, 15, 16, 11, 40, 28, 18, 30, 32, 20, 21, 42, 60 -, 10, 18, 15, 40, 11, 16, 28, 30, 32, 42, 60, 20, 21 a. Neither is a min heap b. Only the second is a min heap c. Only the first is a min heap d. Both are min heaps

neither is a min heap

Which terms refer to operations that can be performed on a stack (check all that apply). a. Enqueue b. Dequeue c. Pop d. Push

pop, push

What kind of traversal is performed on an Expression Tree to convert the tree into post-fix notation?

post order

Performing a level order traversal of a binary tree requires the additional use of which data structure. (ENTER ONE WORD ONLY)

queue

Which of the following dimensions can be referenced when using Big O? (check all that apply) a. Length b. Lines of Code c. Bytes d. Width e. Space f. Height g. Time

time and space

Managing a singly linked list and doubly linked list both require the use of a head pointer. Select one: True False

true

Select each name that was identified in the lesson as a type of queue. a. Priority Queue b. Queue c. Performant Queue d. Detraction Queue e. Searchable Queue

Queue, Priority Queue

What is the main advantage that an AVL tree offers over a Binary Search Tree? a. The AVL tree does not allow duplicate values causing it to take up less memory in some cases. b. There is no advantage. Either one offers the same advantages and disadvantages. c. The AVL tree allows the user to Add a Virtual List (AVL) which allows for faster lookups. d. The AVL tree will always remain close to a balanced state no matter what order the data is loaded.

The AVL tree will always remain close to a balanced state no matter what order the data is loaded.

The term branching factor refers to... a. The total number of branches in the tree b. The number of children associated with a specific node c. The total number of leaf nodes d. The height of the tree

The number of children associated with a specific node

The height of a tree is computed as what? a. The number of nodes between the root and the lowest child b. The number of edges between the root and the lowest child c. The total number of nodes in the tree d. The total number of leaf nodes plus one

The number of edges between the root and the lowest child

When implementing a hashing solution, what statement below is false? a. Your hashing function should produce an even distribution of hashed values given each member of the dataset. b. You are not obligated to use Open Addressing. c. You only need to implement a collision resolution policy if the data looks like it will produce similar hash values.

You only need to implement a collision resolution policy if the data looks like it will produce similar hash values.

A Heap is an embodiment of what special data structure? a. A Doubly Linked List b. A Priority Queue c. A Prioritized Stack d. A Binary Tree

a priority queue

Big O is the term used to measure the an algorithm's what? a. Lines of Code b. Compiled number of bytes c. Effectiveness d. Complexity

d. Complecity

A Max Heap is a heap where ... a. Each child's value is less than it's parent b. Each parent node holds the maximum value found among it's children c. The tree has the maximum number of nodes possible

each child value is less than its parent

A 2-3 Tree is a binary tree Select one: True False

false

What is the name of the algorithm used to restore the max heap condition? (ONE WORD ONLY)

heapify

Which of the following are binary tree traversal methods? a. Out-order Traversal b. Must-order Traversal c. Post-order Traversal d. Past-order Traversal e. In-order traversal

in order, post order

What is the name for the notation that we commonly use everyday when we evaluate mathematical expressions (as humans, not computers)? For example (M * X) + B

infix

The conversion from infix to postfix notation requires the use of what data structure? a.A Stack b.A Binary Tree c.A Queue d.A Doubly Linked List

A Stack

Which statements about Java Set implementations are TRUE? a. All Set implementations involve and underlying Hashtable b. When iterating over the values in a Set, there are no guarantees about the order they will appear. c. All Sets ensure that their values are unique

All Sets ensure that their values are unique

Which of the following are true about a 2-3 tree? a.Every node has 1 or 2 values (keys) b. All leaf nodes are found at the bottom level of the tree c. Every tree has 2 or 3 levels d. Every node has 2 or 3 values (keys)

All leaf nodes are found at the bottom level of the tree, Every node has 1 or 2 values (keys)


Kaugnay na mga set ng pag-aaral

2.3 Identification and Authentication

View Set

Leadership CH 7 - communicating with others and working in the interprofessional team

View Set

CH 20; Program Design and technique for aerobic endurance training

View Set

Ch. 5 Practice Questions Part 1 #'s 451-480 - Doppler Instrumentation and Hemodynamics

View Set

Español 1020 Repaso (Capítulo 7)

View Set

Level 23: Mortgage Brokers - Chapter 1: Mortgage Origination

View Set

DAT General Chemistry Mike's Chapter 4 (Periodic Trends)

View Set

BUSINESS LAW C713- General questions & need to knows

View Set

Hatfield: Introductory Maternity and Pediatric Nursing #31

View Set

Chapter 3: Environmental Toxicology

View Set

Chapter 50. Nursing Care of Patients With Peripheral Nervous System Disorders

View Set