Data Structures and Algorithms FINAL

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

Graph

A collection of distinct vertices and distinct edges

Heap

A complete binary tree whose nodes contain comparable objects and are organized as follows. Each node contains an object that is no smaller (or larger) than the objects in its descendants.

Connected Graph

A graph that has a path between between every pair of distinct values.

Acyclic

A graph that has no cycles.

interior node / nonleaf

A node with children. Also a parent.

Leaf

A node with no children.

Cycle (graph)

A path that begins and ends at the same vertex

Double ended queue

A queue that allows you to add, remove, or retrieve entires at both sides (front and back) of the queue.

Priority Queue

A queue that organizes objects according to their priorities.

Bucket

A second resolution to collisions, the bucket alters the structure of the hashtable so that each location can represent more than one value. Resolving collisions by using buckets that are linked chains is called separate chaining.

Tree

A set of nodes connected by edges that indicate the relationship among the nodes. The nodes are arranged in levels that indicate the nodes hierarchy. At the top level is a single node called the root. The nodes at each successive level of a tree are the children of the nodes. A node that has children is the parent. Nodes that share the same parent are siblings. They are also descendants of previous nodes.

Hashing

A technique that determines an arrays index using only an entry's search key. The array itself is called a hash table.

Tail Reference

An external reference to the last node in the chain. Makes it so you don't have to traverse chain to find last node if you only have reference to head of chain.

Subtree

Any node and its decedents form a subtree of the original tree. A subtree of a node is a tree rooted at a child of that node.

Java Stack/Program Stack

At the time the program is called, the activation record is pushed onto a stack called the Java Stack or the Program Stack

Level-Order Traversal

Begins at the root and visits nodes one level at a time. Within a level, it visits nodes from left to right. An example of breadth-first traversal.

Clustering

Collisions that are resolved with linear probing cause groups of consecutive locations in the hash table to be occupied. Each group is called a cluster and the phenomenon is known as primary clustering.

Perfect Hash Function

Example: Search Keys range from 555-0000 to 555-9999, so the hash function will produce indices from 0-9999. If the array has 10,000 elements, each telephone number will correspond to one unique element of the hashTable.

Breadth-First Traversal

Follows a path that explores an entire level before moving to the next level.

Complete Graph

Has an edge between every pair of distinct vertices.

Weighted graph

Has values on its edges.

Maxheap

Here, the object in a node is grater than or equal to its descendant objects.

Minheap

Here, the relation is less than or equal to.

Probing

Locating an open location in the hash table.

Height of tree

Number of levels in a tree

Queue

Organizes entries according to the order in which they were added. First in - First out.

Stack

Organizes its entries according to the order in which they were added. Last In - First Out

Spares/Dense

Sparse if it has few edges. Dense if it has many edges.

Linear Linked Chain

The last node would contain null.

Length of a path

The number of edges that composes it.

Depth-First Traversal

This kind of traversal fully explores one subtree before exploring another. Traversal follows a path that descends the levels of a tree as deeply as possible until it reaches a leaf.

Sequential Search

Use to search a chain of linked nodes. When used with array, objects must have a defined .equals method.

Linear Probing

Used to solve collisions.

Postorder Traversal

Visits the root of a binary tree after visiting the nodes in the roots subtrees. Order: Visit all the nodes in the roots left subtree. Visit all the nodes in the roots right subtree. Visit the root.

Inorder Traversal

Visits the root of a binary tree between visiting the nodes in the roots subtrees. Order: Visit all the nodes in the roots left subtree. Visit the root. Visit all the nodes in the right subtree.

Infix Expression

When a binary operator is between expressions

Full and Complete Binary Trees

When a binary tree of height h has all of its leaves at level h and every nonleaf parent has exactly two children, the tree is said to be full.

Activation Record/Frame

When a method is called, the programs run-time environment creates an objected called the activation record/frame

Program Counter

When a program executes, a special location called the program counter references the current instruction.

Hash Index

When a search key maps or hashes to the index I. I is the hash index.

Unary Operator

When an operator has one operand ie: -5

Binary Operator

When an operator has two operands ie: a + b

General Tree

When each node can have an arbitrary number of children

Binary Tree

When each node has at most two children.

Balanced binary trees.

When each node in a binary tree has two subtrees whose heights are exactly the same.

Directed Graph

When the edges have direction the graph is directed. Also called a diagraph. Graphs without directed edges are undirected.

Circular Linked Chain

When the last node references the first node so no node contains null in its next field.

Doubly Linked Chain

When the nodes can reference the previous node as well as the next node in a chain.

Postfix Expression

When the operator is after the expression

Prefix Expression

When the operator is before the expression.

Circular Array

When the queue reaches the end of the array, we can added entries to the queue at the beginning of the array where there are empty slots.

Binary Search

When you choose one half of a sorted array that can not contain the value you are search for in order to rid of a large portion of the array and increase search efficiency. Look at middle value every time and decided on which side of new array value is to be found.

preorder traversal

When you visit the root before we visit the roots subtrees. We then visit all the nodes in the roosts left subtree before we visit the nodes in the right subtree. Example of depth-first traversal.

Subgraph

a portion of a graph that is itself a graph.

Hash Function

takes a search key and produces the integer index of an element in the hash table. This array element is where you would either store or look for the value associated with a search key.


Conjuntos de estudio relacionados

Marketing Principles Chapter 1-5 Exam

View Set

2.4 Cash Flow: Cash Flow from Assets

View Set

Chapter 23 - The Respiratory System - Test Packet #2

View Set

Lifepac History & Geography Unit 4

View Set

Topic 13: The Industrial Revolution (1750-1914) Quizzes

View Set

PNF/Synergy Patterns Scorebuilders

View Set

Jeroo Chapters 1C (Loops), 1D (If) & 1E (Conditionals/Boolean)

View Set

Therapeutic Exercise Elbow Chapter 18

View Set