www.YoYoBrain.com - Accelerators for Memory and Learning Questions for computer algorithms

Category: Default - (246 questions) Define: symmetric key encryption also known as secret-key encryption, is a cryptography technique that uses a single secret key to both encrypt and decrypt data. Define: cipher text encrypted text Define: asymmetric encryption also known as public-key encryption, relies on key pairs. In a key pair, there is one public key and one private key. Define: hash is a checksum that is unique to a specific file or piece of data. Can be used to verify that a file has not been modified after the hash was generated. Algorithms: describe insertion sort algorithm Start with empty hand and cards face down on the table. Remove one card at a time from the table and insert it into the correct position in left hand. To find the correct position for a card, we compare it with each of the cards already in the hand, from right to left. Algorithms: loop invariant A loop is a statement which allows code to be repeatedly executed;an invariant of a loop is a property that holds before (and after) each repetition Algorithms: selection sort algorithm Sorting n numbers stored in array A by first finding the smallest element of A and exchanging it with A[1], then the second smallest and exchanging it with A[2], etc. Algorithms: merge sort Recursive formula1.) Divide the n-element sequence into 2 sub sequences on n/2 elements each2.) Conquer - sort the 2 sub sequences using merge sort3.) Combine - merge the 2 sorted sub sequences to produce sorted answer. Combine by putting smallest of either array into merged array Algorithms: performance of insertion sort Theta( n^2 ) Algorithms: performance of merge sort Theta( n lg n ) Algorithms: binary search data is sorterdLook at midpoint then you know if it is located higher or lower. Then find mid point of remaining array until element found. Algorithms: asymptotic efficiency of when we are concerned with how the algorithms running time of an algorithm increases with the size of the input in the limit (as input goes to infinity) Algorithms: difference between Theta( n^2 ), Theta has asymptotic upper and lower and O( n^2 ) and Omega( n^2) boundsO has only upper boundOmega has only lower bound Algorithms: Special notation to indicate equality of remaindersIf (a mod n ) = ( b mod n ) Algorithms: we say that a function f(n) is polylogarithmically bounded if f(n) = ______Algorithms:n! = o( ____ )n! = omega( ____ ) n ^ n2 ^ n Algorithms: little oh notationo( n^2 ) indicates an upper bound that is not asymptotically tight Algorithms: little omega notation omega( denotes the lower bound that is not n^2 ) asymptotically tight Algorithms: master method for solving for some constant epsilon > 0, then recurrences of the form T(n) = a T( n/b ) + f(n)case 1 ( - epsilon ) Algorithms: master method for solving recurrences of the form T(n) = a T( n/b ) + f(n)case 2 ( = ) Algorithms: master method for solving for some constant epsilon > 0 and if a f(n/b) recurrences of the form T(n) = a T( n/b ) + <= c f(n) for some constant c < 1 and at f(n)case 3 ( + epsilon) sufficiently large n, then Algorithms: describe coupon collector's a person trying to collect each of b different problem coupons must acquire approximately ( b ln b ) randomly obtained coupons in order to succeed Algorithms: binary data structure an array object that can be viewed as a nearly complete binary .Each node of the tree corresponds to an element of the array that stores the value in the node.The tree is completely filled on all levels except possibly the lowest, which is filled from left up to a point. Algorithms: structure1.) 1.) return [ i / 2 ]2.) return 2i3.) return 2i + 1 Parent(i)2.) Left(i)3.) Right(i) Algorithms: max-heap versus min-heap 1. max-heap property A[ Parent(i) ] >= A[i]2. min heap property A[ Parent(i) ] <= A[i] Algorithms: d-ary heap like a binary heap, but non-leaf nodes have d children instead of 2 Algorithms: m x n Young tableau a m x n matrix such that the entries of each row are in sorted order from left to right and the entries of each column are in sorted order from top to bottom Algorithms: heap-sort algorithm 1.) Build a max-heap data structure in O(n) time2.) Root node is greatest value, so grab for end of array, then run max-heapify to recreate the heap and grab next rootruns in O( n ln n ) time Algorithms: good data structure to maintain a max-heap data structure max-priority queue Algorithms: meaning of floor operator of x Algorithms: meaning of ceiling operator on x Algorithms: selection sort algorithm Go through entire array and find smallest element. Swap with first element.Then repeat with element 2 through n Algorithms: performance of selection sort Theta( n^2 ) Algorithms: quicksort's worst case running Theta( n^2 )Theta( n lg(n) ) time and average-case running time Algorithms: quicksort algorithm choose any array element that is in slots p through r. Call this pivot element. Rearrange the elements so that all elements smaller than pivot are to the left and larger elements to the right. This is called partitioning. Then repeat recursively for each partition. Algorithms: In the worst case, any Omega( n ln(n) ) comparison sorting algorithm for n elements requires ___ comparison between pairs of elements Algorithms: partition method for quicksort rearranges the sub array A[p ... r ] in placex algorithm <- A[r]i <- p - 1for j <- p to r-1..do if A[j] <= x.....then i -< i + 1...... exchange A[i] <- A[j]exchange A[i+1] <- A[r]return i + 1 Algorithms: randomized quicksort algorithm instead of always picking right most element as pivot, pick random element and swap with right most before partition Algorithms: basic idea behind counting sort Assumes each of the n input elements is an integer in the range of 0 to k, for some integer k.Determine, for each input element of x, the number of elements less than x. This info can be used to place element x directly into its position in output array. Algorithms: performance of counting sort O( n ) Algorithms: radix sort sorts based on least significant digit first up to most significant.Digit 1 is lowest order digit and d is highestfor i <- 1 to d... do a stable sort to sort array A on digit i Algorithms: performance of bucket sort runs in linear time when the input is drawn from uniform distribution Algorithms: bucket sort algorithm Divide the interval [0, 1) into n equal sized subintervals, or buckets, and then distribute the n input numbers into buckets. Then do insertion sort on buckets. Algorithms: the ith order statistic of a of n the ith smallest element elements is ______Algorithms: define selection problem Input: a set A of n (distinct) numbers and a number i, with 1 <= i <= nOutput: the element x is a member of A that is larger than exactly i-1 other elements of A Algorithms: asymptotic running time for Theta( n ) selection problem Algorithm: queue implements a first-in, first-out (FIFO) storage policy Algorithms: stack implements a last-in, first-out (LIFO) storage policy Algorithms: stack - insert is often called PUSHPOP _____ and delete is often called _____ Algorithms: queue - insert is often called EnqueueDequeue ____ and delete operation is called _____ Algorithms: linked list data structure with a linear order maintained by pointers in each object Algorithms: scheme for using binary trees to left-child, right-sibling representations represent trees with arbitrary numbers of children Algorithms: direct-address table Used when universe U of keys is reasonably small small. Denoted by T[0, ... m-1], in which each position, or slot, corresponds to a key in the universe U. Slot k points to an element in the set with key K. Algorithms: hash table With hashing, element is stored in slot h(K); that is, we use a hash function h to compute the slot from key K. Algorithms: how is collision handled (2 keys used a chained linked list for keys that collide hash to same spot) in hash table Algorithms: load factor for hashing table for a hash table T with m slots that stores n elements, it is n/m, average number of elements stored in a chain Algorithms: search performance of a hash worst case Theta(n) which corresponds to all table elements stored in one keyexpected search time Theta( 1 + alpha) with alpha = load factor Algorithms: division method for hash table h(k) = k mod n hash function Algorithms: hash function multiplication h(k) = lower bound ( m ( k A mod 1 ) )multiply method for hash table the key by a constant A in range of 0 < A < 1 and extract the fractional part of k * Athen multiply by m and take the floor of the result Algorithms: universal hashing to select the hash function at random from carefully designed class of functions at the beginning of execution. Guarantees that no single input will always evoke worst-case behavior Algorithms: open addressing in hash table all elements are stored in hash table itself Algorithms: how does insertion work in hash we successively exam, or probe, the hash table with open addressing table we find an empty slot into which to put the key Algorithms: linear programming for hash h( k, i ) = ( h'(k) + i ) mod m function in hash table with open addressing Algorithms: problem with linear probing in primary clustering = long runs of occupied open addressing hash tables slots build up, increasing average search time Algorithms: quadratic probing in open use a hash function of the formh(k, i) = ( h'(k) addressing hash table + c1*i + c2*i^2 ) mod m Algorithms: double hashing in open address hash function h(k,i) = ( h1(k) + i h2(k) ) mod hash tables mwhere h1, h2 are auxiliary hash functions Algorithms: perfect hashing use 2 levels hashing scheme with universal hashing at each level. Instead of making a list of the keys hashing to slot j, we use a small secondary hash table S sub j with an associated hash function h sub j Algorithms: binary-search-tree property Let x be a node in a binary . If y is a node in the left subtree of x, they key[y] <= key[x]. If y is a node in the right subtree of x, then key[x] <= key[y] Algorithms: in order tree walk for binary The key of the root is printed between the search tree values in its left subtree and those in its right subtree Algorithms: all the basic operation on a O(h) time, where h is the height of the tree run in ____ Algorithms: the expected height of a O( lg n ) randomly built binary search tree on n keys is ____ Algorithms: on red-black tree we call the black-height of the node, denoted bh(x) number of black nodes on any path from, but not including, a node x down to a leaf the ____ Algorithms: a red-black tree with n internal 2 lg( n + 1 ) nodes has height at most _____ Algorithms: on red-black tree basic O( lg n ) time operations (search, insert, delete) can be run in _____ time Algorithms: on red-black tree - left and right rotation Algorithms: persistent set when we need to maintain past versions of a dynamic set as it is updated Algorithms: AVL tree a binary search tree that is height balanced; for each node x, the heights of the left and right subtree differ by at most 1 Algorithms: binary search tree with modified way of ordering the nodes. Has both key and priority, which is a random number chosen independently for each node. The nodes of the treap are ordered independently for each node. The nodes of the treap are ordered so that the keys obey binary-search tree property and the priorities obey the min-heap property.If v is a child of w, then priority[ v ] > priority[ w ] Algorithms: left / right spine of binary search left spine is the path from the root that tree T consists of only left edgesright spine is the path from the root that consists of only right edges Algorithms: order-statistic tree simply a red-black tree with additional information stored in each node: field size[x].This field contains the number of (internal) nodes in the subtree rooted at x (including x itself) Algorithms: what condition for augmenting a contents of f can be computed using only the red-black tree will allow maintaining of values information in nodes x, left[x], and right[x], during insertion and deletion at O( lg n ) including f[ left[x] ] and f[ right[x] ] performance Algorithms: red-black tree that maintains a dynamic set of elements, with each element containing an interval int[x] Algorithms: what is underlying data structure a red-black tree in which each node x for interval tree contains an interval int[x] and the key of x is the low end point, low[ int[x] ] of the interval. Each node x contains a value max[x] which is the maximum of any interval end point stored in subtree rooted at x Algorithms: Josephus permutation Suppose n people are arranged into a circle and we are given a positive integer m <= n. Beginning with a designated first person, we proceed around the circle, removing every mth person. Continue until everyone is removed. The order in which people are removed from circle defines the (n, m) Josephus permutation of the integers. Algorithms: basic technique in dynamic Applicable when the subproblems of divide programming and conquer are not independent, subproblems share subproblems.A dynamic-programming algorithm solves every subproblem just once and then saves its answer in a table. Algorithms: 4 steps to develop a 1. Characterize the structure of an optimal dynamic-programming algorithm solution2. Recursively define the value of an optimal solution3. Compute the value of the optimal solution in a bottom-up fashion4. Construct an optimal solution from computed information Algorithms: optimal substructure property when an optimal solution to a problem contains within it an optimal solution to sub problems Algorithms: given a sequence x = { x1, x2, ..., sequence Z = { z1, z2, ... , z sub k} if there xn } what is a subsequence of X exists a strictly sequence (i1, i2, .... i sub k) of indices X such that for all j = 1, 2, ..., k we have x sub i j = z sub i j Algorithms: common subsequence of x and y a sequence z that is a subsequence of both x and y Algorithm: optimal binary search tree Formerly, we are given sequence K = [ K1, K2, ... , Kn ] of n distinct keys in sorted order (so that K1 < K2 < ... < Kn) and we wish to build a binary search tree from these keys. For each key K we have a probability p1 that a search will be for K1. We wish to construct a binary search tree whose expected search cost is smallest Algorithm: the problem of finding an NP Complete unweighted longest simple path is ____ hard Algorithms: Horner's rule for evaluating a follow the patterny = c1 x^3 + c2 x^2 + c3 x + polynomial c4evaluate withy = (( c1 x + c2) x + c3) x + c4 Algorithms: Stirlings approximation to n! Algorithms: iterated logarithm of nlog* n The number of times the logarithm function must be iteratively applied before result is <= 1 Algorithms: maximum subarray of A the nonempty, contiguous subbarray whose values have the largest sum Algorithms: hat-check problem Each of n customers gives a hat to a hat-check person at restaurant. The hat check person gives the hats back to customers at random. What is the expected number of customers who get back their own hat. Algorithms: Good method for generating a Permute array in place. In the ith iteration, random permutation choose the element A[i] randomly from among elements A[i] through A[n] Algorithms: In coupon collectors problem, it b ln (b) takes approximately ___ picks before you expect to get every coupon Algorithms: satellite data remainder of data beyond key Algorithms: how does the pivot in quick sort work Algorithms: when picking the pivot for choose the pivot as the median of a set of 3 quicksort what is median-of-3 method elements randomly selected from subarray Algorithms: decision tree full that represents the comparisons between elements that are performed by a particular sorting algorithm operating on an input of a given size Algorithms: counting sort determines, for the number of elements less than x each input element, ______Algorithms: stability in sorting numbers with the same value appear in the output array in the same order as they do in the input array Algorithms: given n d-digit numbers in which Omega( d ( n + k )) each digit can take on up to k possible values, radix sort takes ____ time Algorithms: how to determine both process elements in pairs, compare to each maximum and minimum simultaneously with other, then compare lowest to current 3 ( n / 2 ) comparisons minimum and highest to current maximum Algorithms: select algorithm with Omega(n) determine the ith smallest of an input array of in worst case n>1 distinct elements1.) Divide n elements of input into [n/5] groups2.) Find median of each group3.) Use select recursively to find median of x of [n/5] medians found in step 24.) Partition the input array around median of medians5.) If i=k return x. Otherwise use select recursively to find ith element. Algorithms: post-office location problem We are given n points, p1, p2, ... , pn with associated weights w1, w2, .... , wn. We wish to find a point p (not necessarily one of the input points) that minimizes the sum:where d(a, b) is the distance between points a and b Algorithms: operations supported on insert elements intodelete elements fromtest dictionary membership in a set Algorithms: sentinel a dummy object that allows simplification of boundary conditions (rather than nil ) Algorithms: direct-address table A table in which each position, or slot, corresponds to a key in universe U.A slot exists for every key in set Algorithms: design a universal class of hash We begin by choosing a prime number p, so functions that every key k is in a range 0 to p-1, inclusive. Let Zp denote the set (0,1,2,...., p-1) and let Z denote the set {1, 2, ...., p-1}. Because we assume that the size of the universe of keys is greater than the number of slots in the hash table, we have p>m. We define hash function for any a that is member of Z*p and b is element of Zp Algorithms: Given an open-address hash 1 / (1 - alpha) table with load factor alpha = n/m < 1, the expected number of probes in an unsuccessful search is at most ______, assuming uniform hashing. Algorithms: we call a hashing technique O(1) memory access are required to perform perfect hashing if ______a search in worst case Algorithms: a red-black tree with internal 2 lg ( n + 1 ) nodes has height at most _____ Algorithms: AVL tree binary search tree that is height balanced for each node x, the height of the left and right subtree of x differ by at most 1 Algorithms: 2 ways to solve dynamic 1.) top-down with memoization2.) bottom-up problems method - sort the problems by size and solve them in size order, smallest first Algorithms: order-statistic tree T simply a red-black tree with additional information stored in each node. We have another attribute, x.size. This contains the number of (internal) nodes in the subtree rooted at x Algorithms: interval tree a red-black tree that maintains a dynamic set of elements with each element x containing an internal x.int Algorithms: dynamic programming applies subproblems overlap, when subproblems when ______share subproblems Algorithms: a problem exhibits optimal optimal solutions to a problem incorporate substructure when ______optimal solutions to related subproblems, which may be solved independently Algorithms: Catalan numbers the nth Catalan number:1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904147324, 4861946401452, Algorithms: difference between shortest shortest path - independent so greedy path path between nodes on graph and longest algorithm will worklongest path - not simple path independent so greedy path doesn't work Algorithms: when a recursive algorithm overlapping subproblems revisits the same problem repeatedly, we say the optimization problem has ______Algorithms: a memoized recursive algorithm an entry in a table for the solutions to each maintains ______subproblem. When the subproblem is first encountered in the recursive algorithm, its solution is computed and stored in the table Algorithms: optimal substructure of the Let two sequences be defined as follows: X = longest common substructure (x1, x2...xm) and Y = (y1, y2...yn). The prefixes of X are X1, 2,...m; the prefixes of Y are Y1, 2,...n. Let LCS(Xi, Yj) represent the set of longest common subsequence of prefixes Xi and Yj. This set of sequences is given by the following. Algorithms: bitonic tours for traveling tours that start at the leftmost point, go salesman problem strictly rightward to the rightmost point, then go strictly leftward back to the starting point Algorithms: greedy algorithm always makes the choice that looks best at the moment. Makes a locally optimal choice in hope that this choice will lead to globally optimal solution Algorithms: interval-graph coloring problem create an interval graph whose vertices are the given activities whose edges connect incompatible activities. The smallest number of colors required to color every vertex so that no 2 adjacent vertices have same color Algorithms: 0-1 knapsack problem A thief robbing a store finds n items. The ith item worth v1 dollars and weighs w1 pounds, where v1 and w1 are integers. The thief wants to take a valuable a load as possible, but he can carry at most W pounds Algorithms: fractional knapsack problem same as 0-1 knapsack but thief can take fractions of items, rather than having to make a binary (0-1) choice for each item Algorithms: No codeword is also a prefix of prefix codes some other codeword, such codes are called ______Algorithms: Huffman code Huffman's scheme uses a table of frequency of occurrence for each symbol (or character) in the input.This table may be derived from the input itself or from data whichis representative of the input.For instance, the frequency of occurrence of letters in normal Englishmight be derived from processing a large number of text documents andthen used for encoding all text documents.We then need to assign a variable-length bit string to each characterthat unambiguously represents that character. This means that the encoding foreach character must have a unique prefix.If the characters to be encoded are arranged in a binary tree: Algorithms: matroid ordered pair M = (S, I)1.) S is a finite set2.) I is nonempty family of sets, called independent subsets of S, such that B is element in I and A is subset of B, then A is member of I. I.E. - it is hereditary 3.) If A is member of I, B is member of I and |A| < |B|, then there exists some element x is member B - A, such that A union {x} is element of I. Satisfies exchange property. Algorithms: matrix matroids elements of S are the rows of a given matrix and a set of rows is independent if they are linearly independent in the usual sense Algorithms: graphic matroid a graphic matroid (also called a cycle matroid or polygon matroid) is a matroid whose independent sets are the forests in a given undirected graph. Algorithms: If G=(V,E) is an _____, then MG undirected graph = (SG, IG) is a matriod Algorithms: Given a matroid M=(S, I ), we extension call an element x not member A an _____ of A is member of I if we can add x to A while preserving independence. Algorithms: spanning tree of undirected Every maximal independent subset of MG graph G must be a tree with exactly |V|-1 edges that connect all their vertices of G Algorithms: minimum spanning tree problem When given a connected undirected graph G=(V,E) and a length function w such that w(e) is the length of edge e. We wish to find a subset of the edges that connect the vertices together and has minimum total length. Algorithms: many problems for which greedy maximal-weight independent subseta approach provides optimal solutions can be weighted matroid formulated in terms of finding a ______in a ______Algorithms: greedy algorithm that works for Takes as input a weighted matroid M = (S, I) any weighted matroid with an associated positive weight function W.Considers in turn each element x in S, in order of monotonically decreasing weight, and immediately add it to the set A being accumulated if A union {a} is independent. Algorithms: greedy strategy furthest-in-future evict item in cache whose next access in (for caching) request sequence comes furthest in the future Algorithms: explain the exchange property of If you have 2 independent sets A and B and matroids A is smaller than B, you can find an element in B, x, that can be added to A and A will stay independent Algorithms: what do the properties of matroid the elements in each set I are independent say about sets I in matroid M=(E, I) of each other (ex: linearly independent vectors) Algorithms: describe two parts of matroid ( E is set of finite elementsI - sets of elements E, I ) in E that are "independent" of each other Algorithms: 3 properties that show 1. null set is member2. If one set is subset of "independence" of elements in I sets in another member of I, then subset is member matroid (E, I ) (subsets of independent elements are independent)3.) Exchange property - 2 separate sets A and B. If A is smaller than B, then there is an element in B that can be added to A and A stays independent Algorithms: Let E be a finite set of vectors in a matroid a vector space V and I be a collection of linearly independent subsets of E, then (E, I) is ____ Algorithms: Let G=(V,E) be a graph. What the set of edges does not form any cycles property would you need for I to be a collection of independent sets of edges (matroid) Algorithms: the matroids (E,I) and (E', I') are there is a bijection from E to E' which isomorphic (same) if ______induces a bijection from I to I'(same matroid with different names for the elements) Algorithms: linear matroid is one isomorphic to the matroid of vector configuration Algorithms: graphical matroid one isomorphic to the matroid of a graph Algorithms: transversal matroid one isomorphic to the matroid of matching problem Algorithms: a basis of a matroid is ______maximal (by containment) independent sets Algorithms: all the bases of a matroid have the same size ______Algorithms: amortized analysis average the time required to perform a sequence of data-structures operations over all the operations performed Algorithms: aggregate analysis we show that for all n, a sequence of n operations takes worst-case time T(n) in total Algorithms: accounting method of amortized we assign differing charges to different analysis operations. With some operations charged more or less than the actual cost Algorithms: potential method of amortized represents the prepaid work as "potential analysis energy" which can be released to pay for future operations. We associate the potential with data structures as a whole rather than with specific objects within the data structure Algorithms: In a binary tree, a given node is x.left.size <= alpha * x.size and x.right.size x alpha-balanced if ____ <= alpha * x.size Algorithms: self-organizing list is a linked list of n elements, in which each element has a unique key2 properties1.) To find an element in a list, given its key, we must traverse the list from the beginning until we encounter the element with the key.2.) We may reorder the list elements after any operation, according to a given rule with a given cost Algorithms: B-trees are similar to red-black minimizing disk I/O operations trees, but are better at ______Algorithms: Basic way B-trees are different B-tree nodes may have many children from a from red-black trees few to a thousand Algorithms: a common variant on a B-tree, stores all the satellite information in the known as B+-tree leaves and stores only the keys and child pointers in the internal nodes Algorithms: In B-trees, every node x has 1. at x.n the number of keys stored in node following attributes x2. The x.n keys themselves, x.key1, ..., x.keyn stored in decreasing order that x.key1 < x.key2 < .... < s.keyn .3. x.leaf, a boolean value is True if x is a leaf and False if a lateral node Algorithms: In B-tree all leaves have some depth, which is the trees height h ______Algorithms: minimum degree of B-tree nodes have lower and upper bound on number of keys that they can contain Algorithms: 2-3-4 B-tree when every internal node has either 2,3, or 4 children Algorithms: number of disk accesses proportional to the height of the B-tree required for most operations in a B-tree is ______Algorithms: If n>=1, then for any n-key B-tree logt ( n+1 / 2 ) T of height h and min. degree t >= 2 the height h <= ______Algorithms: variant on B-tree, known as requires each internal node to be at least 2/3 B*-tree ______full, rather than at least 1/2 full as a B-tree requires Algorithms: The power of B-trees as the base of the logarithm can be many times compared with red-black trees. Height of larger tree grows as O( lg n ) in both cases, for B-tree ______Algorithms: mergeable heap is any data 1.) make heap - create new heap with no structure which supports 5 operations in elements2.) insert - element x3.) minimum - which each extends has key point to element with minimum key4.) extract min - delete element with min key and return pointer to5.) union - create new heap with all elements from 2 heaps Algorithms: 2 additional operation for 1.) decrease key - assigns new key to over mergeable heap element, which is < current key2.) delete - delete element x from heap Algorithms: how many spanning trees does a Make Laplacian of graph GForm a VxV connected graph have (matrix-tree theorem) matrix LLvv = degree of v (number of edges out of)Luv = - ( number of edges between u and v)The number of spanning trees of G = any cofactor of Laplacian matrix of G Algorithms: which operation takes union takes O(n) on binary heap versus O(1) significantly more time on binary heap on Fibonacci heap versus Fibonacci heap Algorithms: what operations run in better insert, union, and decrease-key asymptotic time on Fibonacci heap than binary heap Algorithms: from theoretical standpoint, extract-mindelete Fibonacci heaps are especially desirable when number of ___ and ___ operations is small relative to the number of other operations Algorithms: what makes Fibonacci heaps a constant factors and programming less desirable structure versus binary heaps complexity Algorithms: type of situation Fibonacci heaps certain applications that manage large are useful amounts of data Algorithms: Fibonacci heap is a ______a collection of rooted trees that are min-heap ordered. That is each tree obeys the min-heap property: the key of a node is greater than or equal to the key of its parents Algorithms: binomial tree Bk ordered tree defined recursivelyB0 - consists of a single nodeThe binomial tree Bk consists of 2 binomial trees Bk-1 that are linked together so that the root of one is the left most-child of the other Algorithms: restrictions on keys on van the keys must be integers in range 0 to n-1, Emde Boas trees with no duplicates Algorithms: van Emde Boas trees support O( lg lg n ) search, insert, delete, minimum, maximum, successor, and predecessor in ____ time Algorithms: cell probe model all operation are free except memory access. Useful for proving lower bounds of algorithms for data structure problems Algorithms: predecessor problem operations supported: insert, delete,predecessor: max { y element of S | y < x}successor: min { y is element of S | y > x }maintains set S of n elements that are elements of U Algorithms: word (computer model) w bit integerthat is element of U = {0, 1, ..., 2^w - 1}2^w - 1 = u Algorithms: transdichotomous RAM memory is an array, each slot is an array of S wordsoperations - reads/writes O(1) wordswords can serve as pointers Algorithms: word RAM model transdichotomous RAM where operations are restricted with C-like operations +, -, *, /, %, &, |, ^, ~, <<, >>, <, > Algorithms: standard computation model for word RAM integer data structure Algorithms: disjoint-set data structure maintains a collection S = {S1, S2, ... Sk} of disjoint dynamic sets Algorithms: representative of disjoint-set some member of the set data structure Algorithms: disjoint-set operations support make-setunionfind set - return pointer to the 3 operations representative of set containing X Algorithms: weighted-union heuristic for when each list includes the length of the list disjoint set and we always append the shorter list onto the longer, breaking ties arbitrarily Algorithms: disjoint-set forest represents set by rooted trees, with each node containing one member and each tree representing 1 set Algorithms: union by rank in disjoint-set Rather than explicitly keeping track of the forest size of the subtree rooted at each node, we maintain a rank which is the upper bound on the height of the node. In union by rank, we make the root with a smaller rank point to the root with larger rank during union. Algorithms: 2 standard ways to represent adjacency listadjacency matrix data structure for a graph G = (V, E) Algorithms: When to prefer adjacency list works for sparse graph those for which | E | data representation of graph G=(V,E) is much less than | V |^2 Algorithms: when to prefer an adjacency when graph is dense |E| is close |V|^2 matrix representation for graph G=(V,E) Algorithms: adjacency-list representation of consists of an array Adj of |V| lists, one for graph G=(V,E) each vertex. For each u that is element of V, the adjacency list Adj[u] contains all the vertices v such that there is an edge (u,v) that is element in E Algorithms: universal sink in graph G=(V, E) a vertex with in-degree |V|-1 and out degree 0 Algorithms: breadth-first graph search expands the frontier between discovered and undiscovered vertices uniformly across the breadth of frontier. The algorithm discovers all vertices at distance k from s before discovering vertices at distance k+1 Algorithms: predecessor or parent of v in Whenever the search discovers a white breadth-first tree (graph) vertex V in course of scanning the adjacency list of already discovered vertex u, the vertex v and edge (u,v) are added to tree. u is parent of v. Algorithms: in breadth-first search (graphs) O( V )O( V + E) the overhead for initialization is ___ and total running time is ____ Algorithms: on graphs, the shortest-path the minimum number of edges in any path distance d(s,v) from s to v is _____ from vertex s to vertex v Algorithms:is a predecessor subgraph of G if ______Algorithm: the predecessor subgraph G1 is V1 consists of the vertices reachable from s a breadth-first tree if _____ and, for all v is member of V1, the subgraph contains a unique simple path from s to v that is also the shortest path from s to v in G Algorithm: We call the edges E1 in a tree edges breadth-first tree ______Algorithm: Bloom filter space efficient probabilistic data structure that is used to test whether an element is a member of set. False positives are possible, but false negatives are not: returns either "possible in set" or "definitely not in set" Algorithm: Base data structure and algorithm data structure - bit vectorTo add an element of Bloom filter to Bloom filter, we hash it a few times and set the bits in the bit vector of the index of those hashes to 1. Then to test a value check to see if all the positions have a 1. Algorithm: diameter of a tree T=(V,E) is max u,v in V where d(u,v), that is, the largest _____ of all the shortest path distances in the tree Algorithm: depth-first search in graph to search deeper in the graph whenever G=(V,E) possible. Explores edges out of the most recently discovered vertex that still has unexplored edges, leaving it once all of v's edges have been explored. The "search backtracks" to explore edges leaving vertex where v was discovered. Algorithm: predecessor subgraph of depth-first search Algorithm: the predecessor subgraph of a depth-first forestdepth-first treestree edges depth-first forms a _____ comprising several _____. The edges in E1 are _____ Algorithm: the running time of depth-first O( V + E )vertex + edges search is ______Algorithm: the most basic property of forms a forest of trees depth-first search is that the predecessor subgraph G1 does ______Algorithm: the parenthesis structure of If we represent the discovery of vertex a with depth-first search on discovery and finishing left parenthesis "(a" and represent its time finishing by a right parethesis "a)" then history of discoveries and finishings are properly nested by parenthesis Algorithm: tree edges in depth-first search Edge(u,v) is a tree edge if v was first discovered by exploring edge (u,v) Algorithm: Back edge in depth-first search those edges (u,v) connecting a vertex u to an ancestor v in depth-first tree Algorithm: forward edges in depth-first non-tree edges (u,v) connecting a vertex u to search a descendent v in a depth-first tree Algorithm: cross edges in depth-first search all none forward, back and tree edges. They can go between vertices in the same depth-first tree, as long as one vertex is not an ancestor of other, or they can go between vertices in different depth-first trees Algorithm: directed graph G=(V,E) is singly u ~> v implies that G contains at most one connected if _____ simple path from u to v for all vertices u,v in V Algorithm: topological sort of a directed linear ordering of all its vertices such that G acyclic graph G=(V,E) is ______contains an edge (u,v) then u appears before v in the ordering Algorithm: topological sort algorithm of dag 1. call depth first search to compute finishing G=(V,E) times v.f for each vertex v.2. as each vertex finishes insert it into the front of a linked list3. return a linked list of vertices Algorithm: directed graph G is acyclic if and a depth-first search of G yields no back only if _____ edges Algorithm: use of HyperLogLog approximation technique for computing the number of distinct entities in a set (cardinality) Algorithm: use of MinHash technique for quickly estimating how similar 2 sets are Algorithms: strongly connected component a maximal set of vertices C is subset of V of a directed graph G=(V,E) such that for every pair of vertices u and v in C, we have both u~>v and v~>u; that is vertices u and v are reachable from each other Algorithms: transpose of directed graph it is G with all of its edges reversed Algorithms: algo. for computing the strongly 2 DFS (depth first search)1. Call DFS(G) to connected components of directed graph compute finishing times u.f for each vertex G=(V,E) u2. compute transpose of G3. compute DFS( transpose of G) but in main loop consider vertices in order of decreasing u.f4. Output the vertices of each tree in depth-first formed in line 3 as a separate strongly connected component Algorithms: component graph G suppose that G has strongly connected components C1, C2, ... Ck. The vertex V is (v1, v2, ..., vk) and it contains a vertex vi for each strongly connected component Ci of G. There is an edge for every edge between strongly connected vertices. Algorithms: key property of component it is a dag (directed acyclic graph) graph Algorithms: minimum spanning tree problem when we have graph G=(V,E) where each edge has a weight. When we want to find an acyclic subset T is subset of E that connects all the vertices and minimizes total edge weight. Algorithms: A directed graph is for all pairs of vertices u,v that belong to V, semiconnected if ______we have u~>v or v~>u Algorithms: Let G=(V,E) that be a a vertex whose removal disconnects G connected, undirected graph. Define articulation point Algorithms: Let G=(V,E) be a connected, a minimal set of edges such that any 2 undirected graph. A biconnected component edges in the set lie on a common simple of G is ______cycle. Algorithms: Let G=(V,E) be a connected, an edge whose removal disconnects G undirected graph. A bridge of G is _____ Algorithms: A cut (S, V-S) of an undirected a partition of V graph G = (V,E) is ______Algorithms: For an undirected graph G=(V,E) one of its endpoints is in S and the other in we say that an edge (u,v) that is in E V-S crosses the cut (S, V-S) if _____ Algorithms: For undirected graph G=(V,E) no edge in A crosses the cut we say that a cut respects a set A of edges if ______Algorithms: For undirected graph G=(V,E), its weight is the minimum of any edge we say an edge is light edge crossing a cut if crossing the cut _____ Algorithms: Let G=(V,E) be a connected, Let (S, V-S) be any cut of G that respects A, undirected graph with real-value weight and pick (u,v) to be a light edge crossing (S, function w defined on E. Let A be a subset V-S) of E that is included in some minimum spanning tree for G. What edge would be safe to add to A? Alg: vertex cover of a graph set of vertices such that each graph is incident to at least 1 vertex of the set Alg: vacuous truth a statement that all members of the empty set have a certain propertyex: "all cell phones in the room are turned off" may be true simply because there are no cell phones in the room Algo: a problem has optimal substructure if a globally optimal solution can be found by ______combining optimal solutions for local subproblems Algo: a problem has overlapping an optimal solution involves solving the same subproblems if ______problem multiple times Category: cryptology - (8 questions) Define: Advanced Encryption Standard - a synonym for Rijndael, which is a symmetric AES encryption algorithm that uses keys sizes of 128 through 256 bits Define: Data Encryption Standard - DES A symmetric encryption algorithm that uses relatively short key lengths that are vulnerable to cracking attacks Define: initialization vector - IV data that symmetric encryption algorithms use to further obscure the first block of data being encrypted, which makes unauthorized decrypting more difficult Define: keyed hash algorithms algorithms that protect against modifications of the hash by encrypting it by using a secret key that both the sender and receiver must have Define: MD5 The Message Digest algorithm. The hash size for the MD5 algorithm is 128 bits Define: RC2 A symmetric encryption algorithm standard designed to replace Data Encryption Standard (DES) that uses variable key sizes Define: Rijndael symmetric encryption algorithm that uses key sizes of 128 through 256 bits. As a government encryption standard, this algorithm is also known as AES. Define: SHA1 The Secure Hash Algorithm 1. The hash size for the SHA1 algorithm is 160 bits.