cs301 Short Notes Share by Students
cs301 Short Notes Share by Students
Abstract Data A set of data values and associated operations that are precisely specified
Type : independent of any particular implementation. Also known as ADT
In programming, a list of data values, all of the same type, any element of
which can be referenced by an expression consisting of the array name
Array : followed by an indexing expression. Arrays are part of the fundamentals
of data structures, which, in turn, are a major fundamental of computer
programming
A balanced binary search tree where the height of the two subtrees
AVL tree :
(children) of a node differs by at most one.
A binary tree where no leaf is more than a certain amount farther from the
Balanced
root than any other. After inserting or deleting a node, the tree may
Binary Tree :
rebalanced with "rotations."
A complete binary tree where every node has a key more extreme (greater
Binary Heap :
or less) than or equal to the key of its parent.
Binary Search A data structure with in which every node refers to a left subtree and a
Tree : right subtree such that all values in the left subtree are smaller than the
value in the node and all elements in the right subtree are greater than (or
equal to) the value in the node. The top node is called the root. The nodes
Word Definition
with no children (left and right subtrees empty) are called leaves.
A specific type of tree data structure in which each node has at most two
sub trees, one left and one right. Binary trees are often used for sorting
Binary Tree : information; each node of the binary search tree contains a key, with
values less than that key added to left subtree and values greater than that
key added to the right subtree.
Bounded
A queue limited to a fixed number of items.
Queue :
An item of a tree referred to by a parent item. Every item, except the root,
Child :
is the child of some parent.
Circular List : A linked list in which the rear item refers back to the head item
Circular
An implementation of a bounded queue using an array.
Queue :
When two or more items should be kept in the same location, especially in
Collision : hash tables, that is, when two or more different keys hash to the same
value.
A way of handling collisions, that is, when two or more items should be
kept in the same location, especially in a hash table. The general ways are
Collision
keeping subsequent items within the table (open addressing), keeping a
Resolution
list for items which collide (direct chaining hashing or separate chaining
Scheme :
hashing), keeping a special overflow area, etc. Perfect hashes avoid
collisions, but may be time-consuming to create.
Complete A complete binary tree of depth d is the strictly binary tree all of whose
Binary Tree : leaves are at level d
The term data structure refers to the way data is organized for use within a
Data program. Correct organization of data can lead to simpler and more
Structure : efficient algorithms. Common data structures are linked-lists, stacks,
queues and trees.
Descendant : A child of a node in a tree, any of the children of the children, etc.
Disjoint Set : A set whose members do not overlap, are not duplicated, etc.
Doubly A data structure in which each element contains pointers to the next and
Linked List : previous elements in the list, thus forming a bidirectional linear list.
Dynamic An array whose size may change over time. Items are not only added or
Array : removed, but memory used changes, too.
First in first out is a policy that items are processed in order of arrival. A
FIFO :
queue implements this.
full binary
A binary tree in which each node has exactly zero or two children.
tree :
Hash A function that maps keys to integers, usually to get an even distribution
Function : on a smaller set of values.
Heap : An area of memory from which space for dynamic structures are allocated
heap property Each node in a tree has a key which is more extreme (greater or less) than
: or equal to the key of its parent.
A complete tree where every node has a key more extreme (greater or
heap. : less) than or equal to the key of its parent. Usually understood to be a
binary heap.
Word Definition
Rearrange a heap to maintain the heap property, that is, the key of the root
node is more extreme (greater or less) than or equal to the keys of its
Heapify : children. If the root node's key is not more extreme, swap it with the most
extreme child key, then recursively heapify that child's subtree. The child
subtrees must be heaps to start.
The maximum distance of any leaf from the root of a tree. If a tree has
Height :
only one node (the root), the height is zero.
Infix Notation
A notation in which operators appear between the operands, as in 3 + 5
:
In-order Process all nodes of a tree by recursively processing the left subtree, then
Traversal : processing the root, and finally the right subtree.
Insertion Sort Sort by repeatedly taking the next item and inserting it into the final data
: structure in its proper order with respect to items already inserted.
Internal Node A node of a tree that has one or more child nodes, equivalently, one that is
: not a leaf
Any node (location) in a tree structure that is at the farthest distance from
Leaf : the root (primary node), no matter which path is followed. Thus, in any
tree, a leaf is a node at the end of a branch—one that has no descendants.
Word Definition
In a binary search tree, pushing a node N down and to the left to balance
left rotation : the tree. N's right child replaces N, and the right child's left child becomes
N's right child.
Level-order Process all nodes of a tree by depth: first the root, then the children of the
Traversal : root, etc.
Last in first out is a policy that the most recently arrived item is processed
LIFO :
first. A stack implements this.
max-heap Each node in a tree has a key which is less than or equal to the key of its
property : parent.
A sort algorithm that splits the items to be sorted into two groups,
merge sort : recursively sorts each group, and merges them into a final, sorted
sequence.
min-heap Each node in a tree has a key which is greater than or equal to the key of
property : its parent.
A name tag in C++ is a set of text characters formed into a symbolic word
used to refer to an object. Name tags must start with an alpha character or
an underscore. The second or subsequent characters can be alpha or
Name Tag :
numeric characters or the underscore character. All other characters are
not allowed. Capital alpha characters can be used and are interpreted by
C++ as different to their lower case equivalents.
Node : (1) A unit of reference in a data structure. Also called a vertex in graphs
and trees. (2) A collection of information which must be kept at a single
Word Definition
memory location.
Object : Any program entity which uses physical memory in the computer
A general collision resolution scheme for a hash table in which all items
are stored within the table. In case of collision, other positions are
Open
computed and checked (a probe sequence) until an empty position is
Addressing :
found. Some ways of computing possible new positions are less efficient
because of clustering.
A term used to refer to the use of one symbol for more than one purpose.
Overload : For instance, in mathematics the "-" symbol is used both as a negation
symbol and as a subtraction symbol. In C++ the "<
perfect binary A binary tree with all leaf nodes at the same depth. All internal nodes have
tree : degree 2.
Postorder Process all nodes of a tree by recursively processing the left subtree, then
Traversal : processing the right subtree, and finally the root.
Prefix
A notation in which operators appear before the operands, as in +A B
Notation :
Preorder Process all nodes of a tree by recursively processing the root, then
Traversal : processing the left subtree, and finally the right subtree.
Quicksort : An in-place sort algorithm that uses the divide and conquer paradigm. It
picks an element from the array (the pivot), partitions the remaining
elements into those greater than and less than this pivot, and recursively
Word Definition
In a binary search tree, pushing a node N down and to the right to balance
right
the tree. N's left child replaces N, and the left child's right child becomes
rotation :
N's left child.
A sort algorithm that repeatedly looks through remaining items to find the
Selection
least one and moving it to its final location. The run time is (n2), where n
Sort :
is the number of comparisons. The number of swaps is O(n).
Sibling : A node in a tree that has the same parent as another node is its sibling.
Strictly A binary tree is said to be a strictly binary tree if every non-leaf node in a
Binary Tree : binary tree has non-empty left and right subtrees.
A data structure containing zero or more nodes that are linked together in
Tree :
a hierarchical fashion
Tree
A technique for processing the nodes of a tree in some order.
Traversal :
Union : The union of two sets is a set having all members in either set.
The situation or input that forces an algorithm or data structure to take the
worst case :
most time or resources.