Quizzes 1-6 Data Structures

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is the principle difference in behavior between a stack and a queue?

A stack reverses order whereas a queue preserves order

Many common operations can be defined for all list types. The differences between them stem from how elements are __________.

Added

Two vertices in a graph are ___________ if there is an edge connecting them.

Adjacent

If a binary search tree is not __________, it may be less efficient than a linear structure.

Balanced

In a _____ tree, the paths from the root to all the leaf nodes are about the same length.

Balanced

A collection where each node can have from 0 to 2 children is called a ___________.

Binary tree

The definition of a binary search tree is an extension of the definition of a ______________.

Binary tree

_______ orders a list of values by repetitively comparing neighboring elements and swapping their positions if necessary.

Bubble sort

Each BinaryTreeNode object maintains a reference to the element stored at that node as well as references to each of the node's __________.

Children

An undirected graph is considered _____________ if it has the maximum number of edges connecting vertices.

Complete

The degree to which software adheres to its specific requirements is called

Correctness

A ________ is a path in which the first and last vertices are the same and none of the edges are repeated.

Cycle

One of the uses of trees is to provide _________ implementations of other collections.

Efficient

To add an element to a queue you use the method.

Enqueue

A collection where each node can have from 0 to 3 children is called a Binary Tree. True or false

False

A minheap stores its largest element at the root of the binary tree, and both children of the root of a minheap are also minheaps. True or false

False

An efficient system handles problems gracefully. True or false

False

Because queue operations modify both ends of the collection, fixing one end at index 0 eliminates the requirement that elements be shifted. True or false

False

Bubble, Selection and Insertion sort all have time complexity of O(n). True or false

False

If the algorithm is inefficient, a faster processor will help. True or false

False

Insertion sort is an algorithm that sorts a list of values by repetitively putting a particular value into its final, sorted, position. True or false

False

Speeding up the processor by a factor of 10 will increase the processing speed by a factor of 10 regardless of the efficiency of the algorithm. True or false

False

Stack Elements are processed in a FIFO manner—the first element in is the first element out True or False

False

The TreeSet uses hashing. True or false

False

The big O order of an algorithm provides a lower bound to the algorithm's growth function. True or false

False

The elements of an ordered list do not have an inherent relationship defining their order. True or false

False

The implementation of the collection operations should affect the way users interact with the collection True or false

False

The red-black rules rearrange the nodes in a tree to balance it. True or false

False

The situation in which two keys map to the value rarely occurs in practice. True or false

False

The size of a subtree is equal to the number of descendants of the root of the subtree. True or false

False

The study of the techniques and theory that support the development of high-quality software is electrical engineering. True or false

False

Queues operate as

First In, First Out

A linked implementation of a queue is facilitated by references to the ______ and ______ elements of the linked list.

First, Last

During class the instructor mentioned a free software package for drawing trees. The name of this software is:

Gliffy

A tree is a nonlinear structure whose elements are organized into a __________.

Hierarchy

An _______________ maintains a contiguous numeric index range for its elements.

Indexed list

There are four basic methods for traversing a tree:

Inorder, Level order, postorder, preorder

The implementation of the collection operations should not affect the way users _____________ the collection.

Interact with

In the Java Collections API, sets and maps are ___________ with a wide variety of implementations.

Interfaces

Stacks operate as

Last in, first out

A data structure that uses object reference variables to create links between objects is:

Linked Structure

The _____ sort algorithm sorts a list by recursively dividing the list in half until each sub-list has one element and then merging these sub-lists into the sorted order.

Merge

Which sort method starts by repeatedly splitting the list in half?

Merge

Both children of the root of a minheap are _________.

Minheaps

The leftmost node in a binary search tree will contain the __________ element, while the rightmost node will contain the __________ element.

Minimum maximum

A ________, or a weighted graph, is a graph with weights or costs associated with each edge.

Network

The elements of an _____________ have an inherent relationship defining their order.

Ordered list

List collections can be categorized as ______, ________, or __________.

Ordered, unordered, indexed

A _________ is a sequence of edges that connects two vertices in a graph.

Path

___________ refers to the ability to easily move software from one system to another.

Portability

_________ traversal means visit the node, then the left child, then the right child.

Preorder

Though not a queue at all, a minheap provides an efficient implementation of a _____________.

Priority queue

To add an element to a stack you use the method:

Push

A ______ can be used to preserve the order of a set of data.

Queue

The underlying data structure used by the TreeSet is:

Red Black Tree

A binary search tree is a binary tree with the added property that the left child is less than the parent, which is less than or equal to the ___________.

Right child

______ is the degree to which erroneous situations are handled gracefully.

Robustness

A minheap stores its smallest element at the ________ of the binary tree.

Root

A node that does not have a parent is called the ______ of a tree.

Root

This type of sequential sort algorithm sorts a list by repeatedly placing the next smallest element into its final sorted position.

Selection sort

The Dijkstra algorithm presented in class provides:

Shortest path in a weighted graph

__________ is the process of arranging a list of items into a defined order based on some criteria.

Sorting

A(n) _________ includes all of the vertices of a graph and some but possibly not all the edges.

Spanning Tree

A _____ can be used to reverse the order of a set of data

Stack

What does a growth function show?

Time or space utilization relative to the problem size

A binary search requires O(log n) comparisons. True or false

True

A growth function shows time or space utilization relative to the problem size. True or false

True

A hashing function may be applied more than once. True or false

True

A heap is a special type of tree. True or false

True

A linear search requires O(n) comparisons. True or false

True

A linked list has no set capacity limitations other than the size of the computers memory True or false

True

A linked structure uses object reference variables to link one object to another True or False

True

A minheap is a complete binary tree in which each node is less than or equal to both the left child and the right child. True or false

True

A polymorphic reference can refer to different types of objects over time True or false

True

A reference variable can refer to any object created from any class related to it by inheritance. True or False

True

A tree can be implemented recursively. True or false

True

An indexed list maintains a contiguous numeric index range for its elements. True or false

True

An indexed search is implemented by hashing. True or false

True

An iterator is an object that provides a means to iterate over a collection. True or false

True

By using the interface name as a return type, the interface doesn't commit the method to the use of any particular class that implements a stack. True or false

True

Each BinaryTreeNode object maintains a reference to the element stored at that node as well as references to each of the node's children. True or false

True

If an exception is not caught and handled where it occurs, it is propagated to the calling method True or false

True

In the Josephus problem, Josephus calculated when he would be the last person alive. True or false

True

List collections can be categorized as ordered, unordered, and indexed. True or false

True

Queue elements are processed in a FIFO manner—the first element in is the first element out. True or false

True

Reliability refers to the frequency and criticality of software failure. True or false

True

Reliable software seldom fails and, when it does, it minimizes the effects of that failure. True or false

True

Software must make efficient use of resources such as CPU time and memory. True or false

True

Software that is easily portable, can be moved from one computing environment to another with little or no effort. True or false

True

The Java Collection Framework includes a PriorityQueue class. True or false

True

The elements of an unordered list are kept in whatever order the client chooses. True or false

True

The enqueue and dequeue operations work on opposite ends of the collection. True or false

True

The goal of a hashing strategy is to locate a value in a single step. True or false

True

The leftmost node in a binary search tree will contain the minimum element, while the rightmost node will contain the maximum element. True or false

True

The order in which references are changed is crucial to maintaining a linked list True or false

True

The order of an algorithm is found by eliminating constants and all but the dominant term in the algorithm's growth function. True or false

True

The pop operation is implemented by returning a reference to the element currently stored at the top of the stack and adjusting the top preference to the new top of the stack. True or false

True

Treating arrays as circular eliminates the need to shift elements in an array queue implementation. True or false

True

An undirected graph is a graph where the pairings representing the edges are _____________.

Unordered

The elements of an _____________ are kept in whatever order the client chooses.

Unordered list

Issues related to the interaction between the user and system, including the design of such things as help options, meaningful messages, consistent layout, appropriate use of color, error prevention, and error recovery, are generally referred to as ____________.

Usability

A path in a directed graph is a sequence of directed edges that connects two _________ in a graph.

Vertices

Which of the following is not an aspect of software quality: a. b. Crediblity c. d.

b

Which Growth function has the highest order? a. b. c. O(2n) d.

c

Which of these have the smallest time complexity? a. b. c. Quick sort d.

c

A pop operation on a Stack returns a(n)

element

The level of a node refers to:

generations

The __________ method consists of adding each of the elements of the list to a heap and then removing them one at a time.

heapSort

What is the order of the following growth function? t(n)= 5nlogn + 20n - 4

n log n


Ensembles d'études connexes

AP Classroom Review Questions for Unit 2 APSC Principles

View Set

Intermediate Accounting - Chapter 20

View Set

WGU Organizational Behavior C 715 Quiz questions

View Set