Docsity

Data structures and Algorithms chapter 1, Exercises of Data Structures and Algorithms

Toggle sidebar
bg1
Data structures and
Algorithms chapter 1 - 4
abstract data type - ANSa set of objects together with a set of operations
algorithm - ANSa clearly specified set of simple instructions to be followed to
solve a problem
AVL tree - ANSa binary search tree with a balance condition. For every node
in the tree, the height of the left and right subtrees can differ by at most 1.
B-tree - ANSa self-balancing tree data structure that keeps data sorted and
allows searches, sequential access, insertions, and deletions in logarithmic
time. It is a generalization of a binary search tree in that a node can have
more than two children
binary search tree - ANSa binary tree where items in the left subtree are
smaller than the root of the subtree, and items in the right subtree and
greater than the root of the subtree
binary tree - ANSa tree in which no node can have more than two children
call-by-constant-reference - ANSappropriate for large objects that should not
be altered by the function and are expensive to copy
call-by-reference - ANSappropriate for all objects that may be altered by the
function
pf3
pf4

Partial preview of the text

Download Data structures and Algorithms chapter 1 and more Exercises Data Structures and Algorithms in PDF only on Docsity!

Data structures and

Algorithms chapter 1 - 4

abstract data type - ANSa set of objects together with a set of operations algorithm - ANSa clearly specified set of simple instructions to be followed to solve a problem AVL tree - ANSa binary search tree with a balance condition. For every node in the tree, the height of the left and right subtrees can differ by at most 1. B-tree - ANSa self-balancing tree data structure that keeps data sorted and allows searches, sequential access, insertions, and deletions in logarithmic time. It is a generalization of a binary search tree in that a node can have more than two children binary search tree - ANSa binary tree where items in the left subtree are smaller than the root of the subtree, and items in the right subtree and greater than the root of the subtree binary tree - ANSa tree in which no node can have more than two children call-by-constant-reference - ANSappropriate for large objects that should not be altered by the function and are expensive to copy call-by-reference - ANSappropriate for all objects that may be altered by the function

call-by-value - ANSappropriate for small objects that should not be altered by the function child - ANSsucceeding node depth - ANSthe length of the unique path from the root to ni edge - ANSconnection between two nodes height - ANSlength of the longest path from ni to a leaf inorder traversal - ANSgeneral strategy of (left child, node, right child) leaves - ANSnodes without children length - ANSnumber of edges within a path M-ary tree - ANSa tree that allows M-way branching. As branching increases, the depth decreases map - ANSused to store a collection of ordered entries that consists of unique keys and their values. parent - ANSpreceding node path - ANSa sequence of nodes from n1 to nk

splay tree - ANSany M consecutive tree operations starting from an empty tree take at most O(M logN) time. stack - ANSa list with the restriction that insertions and deletions can be performed in only one position, namely the top T(N) = o(f(N)) - ANSiff for all positive constants c, there exists an n such that T(N) < cf(N) when N > n T(N) = O(f(N)) - ANSiff there are positive constants c and n0 such that T(N) ≤ cf(N) when N ≥ n T(N) = Θ(f(N)) - ANSiff T(N) = O(f(N)) = Ω(f(N)) T(N) = Ω(f(N)) - ANSiff there are positive constants c and n0 such that T(N) ≥ cf(N) when N ≥ n the big 5 - ANSdestructor, copy constructor, move constructor, copy assignment operator =, move assignment operator = tree - ANSa collection of nodes