Massachusetts Institute of Technology Lecture : Theory of Parallel Systems Feb. 25, Lecture 6: List contraction, tree contraction, and

Size: px
Start display at page:

Download "Massachusetts Institute of Technology Lecture : Theory of Parallel Systems Feb. 25, Lecture 6: List contraction, tree contraction, and"

Transcription

1 Massachusetts Istitute of Techology Lecture.89: Theory of Parallel Systems Feb. 5, 997 Professor Charles E. Leiserso Scribe: Guag-Ie Cheg Lecture : List cotractio, tree cotractio, ad symmetry breakig Work-eciet list prex I the previous lecture, we saw a elegat \poiter jumpig" algorithm for computig a prex operatio o a liked list, with a good critical path of (lg ) o a -elemet list. Ufortuately, the poiter jumpig approach requires ( lg ) work for a job that ca easily be doe i liear time o a serial machie. This sectio presets a work-eciet radomized algorithm for prex computatio o a list, with a expected critical path of O(lg ) ad expected work of O(). This algorithm also gives us a work-eciet method for computig ode depths of a biary tree, sice the Euler-tour method see i class reduces the computatio of depths to a list prex.. List cotractio algorithm The key idea is \list cotractio." We are able to reduce the size of the prex calculatio ad the recursively compute the \cotracted" list. Specically, give a associative biary operator ad a list of elemets, umbered from to ad with values a ; a ; : : : ; a, we follow the followig procedure, which we call Radomized-List-Prefix:. Choose victims. We radomly choose a set of elemets for elimiatio from the list, by rst idepedetly (i the probablity sese) labelig each elemet either head or tail, ad the pickig ay head-labeled elemet which is ot followed immediately by a head-labeled elemet. (I this scheme, the last elemet of the list is always chose if it is a head.) The victims form a idepedet set (that is, a subset of the graph i which o two odes are adjacet), sice if a elemet is a victim, its successor is a tail ad its predecessor is followed by a head (the victim itself) ad so either eighbor ca also be a victim.. Splice out victims. The victims are the spliced out of the list by jumpig the poiters of their predecessors over them. As each victim i is removed from the list, its value a i is pushed ito its successor by settig the successor's value to be a i a i+. (Idepedece of victims guaratees that the successor is ot also a victim.) This computatio maitais the followig ivariat: if elemet i has ot bee spliced out of the list, the the product (with respect to, ad i order) of all the values stored i all elemets before i still i the list is equal to [; i], which is the desired al value for elemet i. (Recall that [j; k] where j k is shorthad otatio for a j a j+ : : : a k.)

2 Lecture : List cotractio, tree cotractio, ad symmetry breakig. Recursively compute. We ow recursively call Radomized-List-Prefix o the cotracted list (which i fact may be the same list, if by chace o elemets were elimiated). Due to the ivariat maitaied above, the prex computatio o the cotracted list gives the right aswer for the origial list for o-elimiated elemets. (The base case of recursio is a sigle elemet.). Splice i. Now we wat to splice i the elimiated elemets ito the cotracted list (which ow has the property that elemet i cotais the value [; i]) by restorig the poiters (which, of course, eeded to have bee saved somewhere) ad settig the value of each spliced-i elemet i to a i? a i = [; i? ] [i; i] = [; i]. At this poit, the prex computatio is doe. Figure shows how Radomized-List-Prefix rus o a list of elemets.. Aalysis of work Ituitively, the reaso that list cotractio does less work tha poiter jumpig is that the elimiated elemets icur o further work oce they are spliced i ad out, but i poiter jumpig, every elemet cotiues to icur work at every step (util the base case is reached). We ca show that the expected legth of the list with which Radomized-List-Prefix is called is reduced by a costat fractio at every cotractio. Let k be the legth of the list after k cotractios. Give a list of elemets, for ay elemet i, Pr fi is elimiatedg = ( Pr fi is headg Pr fi's successor is tailg = if i < ; Pr fi is headg = if i = ; ad thus, after cotractio, E [ k ] k?. Substitutig recursively, ad usig the fact that E [E [ k ]] = E [ k ], we have that E [ k ] = k 0 k : This directly leads to a geometric series that upper bouds the amout of work doe. We get a work which is liear i the legth of the list: X k= E [ k ] = () : Therefore the list cotractio algorithm is work-eciet.

3 Lecture : List cotractio, tree cotractio, ad symmetry breakig (a) [, ] [, ] [, ] [, ] [5, 5] [, ] choose victims (b) TAIL HEAD HEAD TAIL HEAD TAIL [, ] [, ] [, ] [, ] [5, 5] [, ] splice out (c) [, ] [, ] [, ] [, ] [5, 5] [5, ] recursively compute (d) [, ] [, ] [, ] [, ] [5, 5] [, ] splice i (e) [, ] [, ] [, ] [, ] [, 5] [, ] Figure : Radomized-List-Prefix ru o a list of elemets. This sequece shows a sigle cotractio. (a) The iput list. (b) Elemets are assiged head or tail ad the victims are chose accordigly. (c) Victims are spliced out, with their values beig pushed ito successors. (d) Prex of the cotracted list is recursively computed. (e) Victims are spliced back i.

4 Lecture : List cotractio, tree cotractio, ad symmetry breakig. Aalysis of critical path The critical path is liear i the umber of cotractios eeded, i.e. the umber of cotractios eeded to reach the base case of a oe-elemet list. Cetral to our probabalistic aalysis is Markov's iquality: for ay oegative radom variable v ad costat t, k. This boud is so Pr fv tg E [v] =t. First we observe that Pr f k g E [ k ] weak that we eed k log = just to beat the trivial boud Pr fv tg. Nevertheless, if we set k = r log = for some costat r, we have o h Pr r log= E r log= r log= = =?r : i Now we aalyze the expected umber of cotractios k. Sice for a oegative itegral radom variable v, E [v] = P i=0 Pr fv = ig i, we have the followig upper boud o k, by groupig the elemets of the expectatio summatio: o E [k] Pr 0 log = < k log = = X X r=0 r=0 X r=0 + Pr log = < k log = + Pr log = < k log = + : : : + log = Pr r log = < k (r + ) log = o Pr k r log = (r + ) log = o Pr k r log = (r + ) log = X r= o o log = log = o Pr k r log = (r + ) log = log = + log = + = log = + O() = (lg ) : X r= o?r (r + ) log = (r + ) log = Thus the critical path of Radomized-List-Prefix is O(lg ).

5 Lecture : List cotractio, tree cotractio, ad symmetry breakig 5 u Figure : Example of treex computatios with the additio operator. The umber iside each ode is the value of the elemet stored there, the umber to the left of each ode is the result of the leax operatio, ad the umber to the right is the result of the rootx operatio. Cosider ode u. Its leax result is the i-order sum of all elemets stores i the tree rooted at u ( = 0), ad its rootx result is the prex sca from the root ( + 0 = ). Treex computatio Suppose we have a biary tree of elemets ad a associative biary operator. I this sectio, we cosider a class of \treex" computatios: a \rootx" operatio computes the -sca of every simple path from root to leaf, ad a \leax" operatio computes, for every ode u, the result of the i-order -product described by the tree rooted at u. Figure shows a example of rootx ad leax with the additio operator.. Rootx computatio with tree cotractio To perform rootx with the additio operator, we ca use the Euler-tour method: for each ode with value v, set the icomig A value to be v, the middle B value to be 0, ad the outgoig C value to be?v. Ufortuately, this method does ot geeralize to ay associative biary operator, sice it requires a iverse, so that the values computed o the way dow (the A values) ca be udoe o the way up (the C values). Maximum, for istace, could ot be computed with a Euler-tour. For a geeral rootx computatio, we use a method iveted by Miller ad Reif [] called \tree cotractio," which is aalogous to list cotractio. Though a determiistic algorithm with the same bouds exists, we cosider a radomized algorithm that is both simpler to aalyze ad geerally faster i practice. This algorithm, Radomized-Rootfix, is aalogous to Radomized-List-Prefix ad works as follows:. Choose victims. To choose odes to be elimiated, we radomly choose pairs of adjacet odes i the biary tree so that all pairs are idepedet (i.e. o pairs share odes), ad select the child of each pair to be a victim. To do this, we make each ode idepedetly choose oe of its eighbors (either paret or childre) based o a

6 Lecture : List cotractio, tree cotractio, ad symmetry breakig Figure : The probability distributio of choosig a eighbor depeds o the umber of childre. (a) Leaves always choose parets. (b) Oe-child odes choose betwee eighbors uiformyly. (c) Nodes with two childre ever choose their paret, guarateeig that the child i ay pair ever has two childre, which guaratees that a biary tree remais biary after pairs are combied. probability distributio that depeds o how may childre the ode has. If two odes choose each other, they are paired. If a ode has o childre, i.e. it is a leaf, the it always chooses its paret. If a ode has oe child, it radomly chooses its paret or child uiformly. (I the special case of a root with oe child, we ca make it always choose its child.) If a ode has two childre, it radomly choose oe of its childre uiformly, ever choosig its paret. Figure shows the three types of odes with the various probabilities.. Splice out. After victims are selected, we cotract the tree by splicig them out, settig the paret's child poiter (whichever oe poited to the victim) to the victim's ow child, if oe exists. We kow that o victim will have two childre, sice odes with two childre ever choose their paret. This property guaratees that a biary tree remais biary after cotractio. As a ode is spliced out, its value is pushed ito its child, if oe exists; specically if u is a victim ad it has a child v, the v's value is set to u v. This maitais the ivariat that the -product of the sequece of odes from the root to ay o-elimiated ode is the correct al value for that ode.. Recursively compute. We recursively compute the roox of the cotracted tree by callig Radomized-Rootfix, with a sigle ode as base case. The ivariat maitaied above isures that the values computed by the rootx of the cotracted tree are the correct values for the origial tree.. Splice i. Now we splice i the previously elimiated odes. As a ode is spliced i, its proper rootx value is calculated from its paret's value (which has bee recursively computed). Specically, if a ode u is the paret of a ode v which is beig spliced i, the value of v is set to u v, which will be the correct al value for v. Figure shows how this method works with the additio operator.

7 Lecture : List cotractio, tree cotractio, ad symmetry breakig 7 (a) 0 7 (e) (b) 0 choose victims v splice i 7 (d) splice out (c) u recursively compute Figure : Example of rootx with the additio operator. (a) The iitial biary tree. (b) Each ode chooses a eighbor, idicated by outgoig arrows, ad the childre of pairs (odes which choose each other) become victims, which are shaded. (c) Victims are spliced out, with their values beig pushed to their childre. For example, ode u becomes + = 8. (d) The rootx of the cotracted tree is computed recursively. Notice these are the correct al values for the odes i the cotracted tree. (e) Victims are spliced back i, with their values beig computed from parets. For example, ode v becomes + = 7.

8 8 Lecture : List cotractio, tree cotractio, ad symmetry breakig. Aalysis of work ad critical path Let k be the umber of odes i the tree after k cotractios. We wat to show that the expected umber of odes i the tree decreases by a costat fractio at each cotractio, ad the the aalysis is the same as that of Radomized-List-Prefix. Cosider a biary tree with odes. Let c i be the umber of odes i the tree with i childre, so = c 0 + c + c. Now we cosider that expected umber of each type of ode that is elimiated durig a cotractio. Sice a ode is elimiated if it chooses its paret ad its paret also chooses it ad these choices are idepedet, the probability that a give ode is elimiated is the probability that it chooses its paret times the probability that its paret choose it. For leaves, this product is =, ad for odes with oe child, it is =. Thus, the expected umber of leaves elimiated is c 0 = ad the expected umber of oe-child odes elimiated is c =. Now recall that a biary tree has the property that c 0 = c +, ad thus c 0 = = c =+=. The the expected total umber of elimiated odes is at least c 0 + c = c 0 + c 0 + c = c 0 + c + (c 0 + c + c ) = : + c Sice the expected umber of odes i the tree decreases by at least a fourth durig each cotractio, we kow by the aalysis see for Radomized-List-Prefix that the expected work of Radomized-Rootfix is O() ad its expected critical path is O(lg ). (I fact, prex computatio o a list is a special case of rootx, ad Radomized-List-Prefix performs a special case of Radomized-Rootfix's fuctioality, with the head ad tail labels beig equivalet to a strig of oe-child odes choosig betwee paret ad child.). Leax computatio with tree cotractio To compute the leax o a tree, we ca use a tree cotractio algorithm which uses the same basic approach as Radomized-Rootfix ad achieve bouds of O() expected work ad O(lg ) expected critical path. However, we have to be more clever, sice the i a leax This is easily proved by iductio: give a biary tree, remove a leaf, ad the c 0 = c + holds by assumptio for the ew tree. Restore the removed leaf: if it is added to a leaf, the c 0 is uchaged sice the ew leaf replaces the leaf it is added to, ad c is also uchaged, ad if it is added to a ode with oe child, the the ew leaf icreases c 0 by oe ad the ode it was added to chages ito a ode with two leaves, also icreasig c by oe.

9 Lecture : List cotractio, tree cotractio, ad symmetry breakig 9 computatio the al value depeds o a etire subtree of elemets as opposed to a list of acestors. Whereas i the rootx calculatio we directly modied the elemet values as odes were spliced i ad out, i our leax calculatio we have each ode keep track of a triple of values ad the modify these triples accordig to some ivariat. Specically, our algorithm Radomized-Leaffix keeps track, at each ode, a triple of costats ha; b; ci, which represets the followig computatio: a l b r c, where l ad r are variables for the leax values of the left ad right childre, or, if a child does ot exist, the idetity I of. For each ode, we iitialize the triple by settig a to be the elemet value ad b ad c to be I. Radomized-Leaffix maitais the ivariat that the al leax value of a ode ca be obtaied by recursively evaluatig the computatio represeted by that ode's triple (i.e. dig the values for l ad r based o the subtrees ad the computig a l b r c). For coveiece, we call this the \triple ivariat." After triples are iitialized, Radomized-Leaffix works as follows:. Choose victims. Radomly choose ode for elimiatio as i Radomized-Rootfix.. Splice out. If u is the paret of a victim v, we push v's triple up ito u's triple as v gets spliced out. Relyig o the fact that v has at most oe child, we adjust the values of v's triple so that the triple ivariat is maitaied. Specically, rememberig that the values i the triple represet a computatio, we eectively substitute the computatio for v ito the computatio for u, ad the combie adjacet costats with. This will result i a computatio that ca be represeted by a triple, sice v has at most oe child. For example, if u's triple is ha u ; b u ; c u i, v's triple is ha v ; b v ; c v i, v is u's right child ad v itself has a left child, the u's triple becomes ha u ; b u a v ; b v I c v c u i. If istead v has a right child, for example, the u's triple becomes ha u ; b u a v I b v ; c v c u i. The key observatios are that this adjustmet of u's triple takes costat time because of the costat size of the triples, there is a costat umber of ways the paret's triple ca be adjusted ad that the triple ivariat is maitaied.. Recursively compute. We recursively compute the leax operatio o the cotracted tree with Radomized-Leaffix, without eedig to iitialize the triples as i the top-level call. The base case is whe a sigle ode, i which case the al leax value is simply a I b I c where ha; b; ci is the ode's triple. After the recursive call, the values computed for the odes i the cotracted tree will be the correct leax values for those odes, due to the triple ivariat.. Splice i. As a ode is spliced back ito the tree, its leax value is computed i costat time by evaluatig the computatio represeted by its triple: hal br ci. This is possible because the value of the ode's child (if oe exists) will have bee recursively computed, so both l ad r are kow (at least oe will be I). At this poit, every ode cotais the leax value ad the algorithm termiates. This algorithm requires to have a idetity, which is ot a additioal costrait o sice a toke idetity ca always be created ad the operator modied to recogize it, if a atural idetity does ot exist.

10 0 Lecture : List cotractio, tree cotractio, ad symmetry breakig Because we have esured that splicig i ad out take costat time, the work ad critical path aalysis for Radomized-Leaffix is the same as that for Radomized-Rootfix, ad thus we have expected work of O() ad expected critical path of O(lg ).. Geeral expressio evaluatio with tree cotractio Radomized-Leaffix works by eectively keepig track of a expressio at each ode (represeted by a triple) which depeds o the expressios of that ode's childre. The key poits are that a victim's expressio ca always be pushed up ito its paret's expressio i costat time durig splicig out, that this pushig up results i a expressio i the same form (so recursio works), that a victim's expressio ca be evaluated i costat time i the base case ad durig splicig i, ad that the triple ivariat is maitaied. This poweful approach is i fact quite geeral ad ca be applied to may biary tree problems. For example, cosider a biary tree that describes a expressio with the + ad operators, where iteral odes each cotai + or ad each leaf cotais a umber. The value of the expressio rooted at ay give ode ca always be formulated as (a l r) + (b l) + (c r) + d (ad thus stored as a -tuple), where a; b; c; d are costats ad l ad r are variables that represet the values of the expressios rooted at the left ad right subtrees. Substitutig a victim's -tuple (which represets a expressio with at most oe o-idetity-valued variable) ito it's paret's -tuple results i a expressio that ca be represeted by the same kid of -tuple. (This is easily see by checkig the possible cases.) The ivariat that a ode's -tuple represets the value of the expressio rooted at that ode is maitaied, ad base case ad evaluatio durig splicig i are straightforward, ad so we are doig essetially the same thig as Radomized-Leaffix with a dieret expressio form at each ode. For other applicatios of this approach, see []. Determiistic symmetry breakig Give a rig of elemets (a circular liked list), how ca we d a large idepedet set of elemets, where by \large" we mea a costat fractio? I Radomized-List-Prefix, we have already see a O()-critical path method for choosig a idepedet set with expected size of =, where is the size of the list. I this sectio we preset a algorithm for doig so determiistically with a critical path of O(lg ). This is called symmetry breakig because if adjacet elemets share a resource (the symmetry), choosig a idepedet set prevets competitio (the breakig). The algorithm Choose-Idepedet-Set works i two steps:. Fid -colorig. First, we d a -colorig of the rig elemets. This is doe by startig with a -colorig, where each elemet is assiged a distict color 0; ; : : : ;? Recall that lg is the miimum umber of repeated applicatios of lg eeded to reduce to at most. It is a very slow fuctio (lg 55 = 5) ad i practice ca be cosidered a small costat.

11 Lecture : List cotractio, tree cotractio, ad symmetry breakig based o its memory locatio (or processor idex, if we have oe processor per elemet), ad iteratively reducig the umber of colors i the colorig (wihtout ever havig same-colored eighbors) i the followig way. Suppose the color idices of the rig are k bits log. Let ha k?; a k?; : : : ; a 0 i be the color bits of a give elemet a, ad hb k?; b k?; : : : ; b 0 i be the colors bits of that elemet's sucessor b. Sice these two colors are dieret, we have some i where a i = b i. The umber i, sice it is less tha k, ca be writte i dlg ke bits: hi dlg ke?; i dlg ke?; : : : ; i 0 i. Assig hi dlg ke?; i dlg ke?; : : : ; i 0 ; a i i to be a's ew color, ad assig ew colors to all elemets i the same way. Now we have a colorig with idices of lg k + bits, sice if the rst dlg ke bits of a elemet's ew color are the same as the successor's rst dlg ke bits, the by costructio the last bit will dier (a i = b i ). This iterative re-colorig will reduce the umber of colors bits per elemet for all k, sice dlg ke + < k for k. Whe k =, the a elemet's color ca dier with its successor's bit i locatio 0,, or, ad so the ew colorig will be oe of the three -bit strigs h0; 0i, h0; i, or h; i cocateated with either 0 or, ad thus the ew colorig will be bits represetig oe of six values. Hece the iterative reductio of colors termiates at six colors, ad sice the umber of bits per color is reduced by a lg at each iteratio, O(lg ) iteratios, each with costat critical path, are eeded.. Choose elemets. To determie the idepedet set of elemets from after - colorig, we start will all elemets marked as live ad the iterate through each color c = 0; ; : : : ; 5, killig ay live eighbors of elemets with color c as we go. There are at least = live elemets left at the ed of this process, because it is impossible to have three cosecutive dead elemets: either the middle elemet kills its eighbors ad thus stays alive, havig o oe left to kill it, or it is killed by oe of its eighbors, ad thus the eighbor stays alive. These remaiig live elemets comprise a idepedet set, sice it is impossible to have two adjacet elemets remai alive: oe would have killed the other. Thus this O()-critical path iteratio gives us a idepedet set of size =. Overall, Choose-Idepedet-Set has O(lg ) critical path. Refereces [] C. E. Leiserso ad B. M. Maggs. Commuicatio-eciet parallel graph algorithms. Algorithmica, pages 5{77, 988. [] G. L. Miller ad J. H. Reif. Parallel tree cotractio ad its applicatios. Proceedigs of the th Aual Symposium o Foudatios i Computer Sciece, pages 78{89, 985. This shows that the set chose is a maximal idepedet set, meaig that we caot revive ay of the dead elemets ad cotiue to have a idepedet set. Note the distictio from havig a maximum idepedet set, the idepedet set with the most elemets; dig the maximum idepedet set is i fact NP-hard.

CIS 121 Data Structures and Algorithms with Java Fall Big-Oh Notation Tuesday, September 5 (Make-up Friday, September 8)

CIS 121 Data Structures and Algorithms with Java Fall Big-Oh Notation Tuesday, September 5 (Make-up Friday, September 8) CIS 11 Data Structures ad Algorithms with Java Fall 017 Big-Oh Notatio Tuesday, September 5 (Make-up Friday, September 8) Learig Goals Review Big-Oh ad lear big/small omega/theta otatios Practice solvig

More information

15-859E: Advanced Algorithms CMU, Spring 2015 Lecture #2: Randomized MST and MST Verification January 14, 2015

15-859E: Advanced Algorithms CMU, Spring 2015 Lecture #2: Randomized MST and MST Verification January 14, 2015 15-859E: Advaced Algorithms CMU, Sprig 2015 Lecture #2: Radomized MST ad MST Verificatio Jauary 14, 2015 Lecturer: Aupam Gupta Scribe: Yu Zhao 1 Prelimiaries I this lecture we are talkig about two cotets:

More information

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13

CIS 121 Data Structures and Algorithms with Java Spring Stacks and Queues Monday, February 12 / Tuesday, February 13 CIS Data Structures ad Algorithms with Java Sprig 08 Stacks ad Queues Moday, February / Tuesday, February Learig Goals Durig this lab, you will: Review stacks ad queues. Lear amortized ruig time aalysis

More information

Lecture 1: Introduction and Strassen s Algorithm

Lecture 1: Introduction and Strassen s Algorithm 5-750: Graduate Algorithms Jauary 7, 08 Lecture : Itroductio ad Strasse s Algorithm Lecturer: Gary Miller Scribe: Robert Parker Itroductio Machie models I this class, we will primarily use the Radom Access

More information

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19

CIS 121 Data Structures and Algorithms with Java Spring Stacks, Queues, and Heaps Monday, February 18 / Tuesday, February 19 CIS Data Structures ad Algorithms with Java Sprig 09 Stacks, Queues, ad Heaps Moday, February 8 / Tuesday, February 9 Stacks ad Queues Recall the stack ad queue ADTs (abstract data types from lecture.

More information

The isoperimetric problem on the hypercube

The isoperimetric problem on the hypercube The isoperimetric problem o the hypercube Prepared by: Steve Butler November 2, 2005 1 The isoperimetric problem We will cosider the -dimesioal hypercube Q Recall that the hypercube Q is a graph whose

More information

1 Graph Sparsfication

1 Graph Sparsfication CME 305: Discrete Mathematics ad Algorithms 1 Graph Sparsficatio I this sectio we discuss the approximatio of a graph G(V, E) by a sparse graph H(V, F ) o the same vertex set. I particular, we cosider

More information

Sorting in Linear Time. Data Structures and Algorithms Andrei Bulatov

Sorting in Linear Time. Data Structures and Algorithms Andrei Bulatov Sortig i Liear Time Data Structures ad Algorithms Adrei Bulatov Algorithms Sortig i Liear Time 7-2 Compariso Sorts The oly test that all the algorithms we have cosidered so far is compariso The oly iformatio

More information

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS)

CSC165H1 Worksheet: Tutorial 8 Algorithm analysis (SOLUTIONS) CSC165H1, Witer 018 Learig Objectives By the ed of this worksheet, you will: Aalyse the ruig time of fuctios cotaiig ested loops. 1. Nested loop variatios. Each of the followig fuctios takes as iput a

More information

Homework 1 Solutions MA 522 Fall 2017

Homework 1 Solutions MA 522 Fall 2017 Homework 1 Solutios MA 5 Fall 017 1. Cosider the searchig problem: Iput A sequece of umbers A = [a 1,..., a ] ad a value v. Output A idex i such that v = A[i] or the special value NIL if v does ot appear

More information

Big-O Analysis. Asymptotics

Big-O Analysis. Asymptotics Big-O Aalysis 1 Defiitio: Suppose that f() ad g() are oegative fuctios of. The we say that f() is O(g()) provided that there are costats C > 0 ad N > 0 such that for all > N, f() Cg(). Big-O expresses

More information

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein

Lecture 6. Lecturer: Ronitt Rubinfeld Scribes: Chen Ziv, Eliav Buchnik, Ophir Arie, Jonathan Gradstein 068.670 Subliear Time Algorithms November, 0 Lecture 6 Lecturer: Roitt Rubifeld Scribes: Che Ziv, Eliav Buchik, Ophir Arie, Joatha Gradstei Lesso overview. Usig the oracle reductio framework for approximatig

More information

6.854J / J Advanced Algorithms Fall 2008

6.854J / J Advanced Algorithms Fall 2008 MIT OpeCourseWare http://ocw.mit.edu 6.854J / 18.415J Advaced Algorithms Fall 2008 For iformatio about citig these materials or our Terms of Use, visit: http://ocw.mit.edu/terms. 18.415/6.854 Advaced Algorithms

More information

prerequisites: 6.046, 6.041/2, ability to do proofs Randomized algorithms: make random choices during run. Main benefits:

prerequisites: 6.046, 6.041/2, ability to do proofs Randomized algorithms: make random choices during run. Main benefits: Itro Admiistrivia. Sigup sheet. prerequisites: 6.046, 6.041/2, ability to do proofs homework weekly (first ext week) collaboratio idepedet homeworks gradig requiremet term project books. questio: scribig?

More information

Hash Tables. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.

Hash Tables. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015. Presetatio for use with the textbook Algorithm Desig ad Applicatios, by M. T. Goodrich ad R. Tamassia, Wiley, 2015 Hash Tables xkcd. http://xkcd.com/221/. Radom Number. Used with permissio uder Creative

More information

Administrative UNSUPERVISED LEARNING. Unsupervised learning. Supervised learning 11/25/13. Final project. No office hours today

Administrative UNSUPERVISED LEARNING. Unsupervised learning. Supervised learning 11/25/13. Final project. No office hours today Admiistrative Fial project No office hours today UNSUPERVISED LEARNING David Kauchak CS 451 Fall 2013 Supervised learig Usupervised learig label label 1 label 3 model/ predictor label 4 label 5 Supervised

More information

CIS 121. Introduction to Trees

CIS 121. Introduction to Trees CIS 121 Itroductio to Trees 1 Tree ADT Tree defiitio q A tree is a set of odes which may be empty q If ot empty, the there is a distiguished ode r, called root ad zero or more o-empty subtrees T 1, T 2,

More information

Combination Labelings Of Graphs

Combination Labelings Of Graphs Applied Mathematics E-Notes, (0), - c ISSN 0-0 Available free at mirror sites of http://wwwmaththuedutw/ame/ Combiatio Labeligs Of Graphs Pak Chig Li y Received February 0 Abstract Suppose G = (V; E) is

More information

The Magma Database file formats

The Magma Database file formats The Magma Database file formats Adrew Gaylard, Bret Pikey, ad Mart-Mari Breedt Johaesburg, South Africa 15th May 2006 1 Summary Magma is a ope-source object database created by Chris Muller, of Kasas City,

More information

n n B. How many subsets of C are there of cardinality n. We are selecting elements for such a

n n B. How many subsets of C are there of cardinality n. We are selecting elements for such a 4. [10] Usig a combiatorial argumet, prove that for 1: = 0 = Let A ad B be disjoit sets of cardiality each ad C = A B. How may subsets of C are there of cardiality. We are selectig elemets for such a subset

More information

Lecture 5. Counting Sort / Radix Sort

Lecture 5. Counting Sort / Radix Sort Lecture 5. Coutig Sort / Radix Sort T. H. Corme, C. E. Leiserso ad R. L. Rivest Itroductio to Algorithms, 3rd Editio, MIT Press, 2009 Sugkyukwa Uiversity Hyuseug Choo choo@skku.edu Copyright 2000-2018

More information

Examples and Applications of Binary Search

Examples and Applications of Binary Search Toy Gog ITEE Uiersity of Queeslad I the secod lecture last week we studied the biary search algorithm that soles the problem of determiig if a particular alue appears i a sorted list of iteger or ot. We

More information

Big-O Analysis. Asymptotics

Big-O Analysis. Asymptotics Big-O Aalysis 1 Defiitio: Suppose that f() ad g() are oegative fuctios of. The we say that f() is O(g()) provided that there are costats C > 0 ad N > 0 such that for all > N, f() Cg(). Big-O expresses

More information

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance

Pseudocode ( 1.1) Analysis of Algorithms. Primitive Operations. Pseudocode Details. Running Time ( 1.1) Estimating performance Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Pseudocode ( 1.1) High-level descriptio of a algorithm More structured

More information

Lecturers: Sanjam Garg and Prasad Raghavendra Feb 21, Midterm 1 Solutions

Lecturers: Sanjam Garg and Prasad Raghavendra Feb 21, Midterm 1 Solutions U.C. Berkeley CS170 : Algorithms Midterm 1 Solutios Lecturers: Sajam Garg ad Prasad Raghavedra Feb 1, 017 Midterm 1 Solutios 1. (4 poits) For the directed graph below, fid all the strogly coected compoets

More information

Basic allocator mechanisms The course that gives CMU its Zip! Memory Management II: Dynamic Storage Allocation Mar 6, 2000.

Basic allocator mechanisms The course that gives CMU its Zip! Memory Management II: Dynamic Storage Allocation Mar 6, 2000. 5-23 The course that gives CM its Zip Memory Maagemet II: Dyamic Storage Allocatio Mar 6, 2000 Topics Segregated lists Buddy system Garbage collectio Mark ad Sweep Copyig eferece coutig Basic allocator

More information

How do we evaluate algorithms?

How do we evaluate algorithms? F2 Readig referece: chapter 2 + slides Algorithm complexity Big O ad big Ω To calculate ruig time Aalysis of recursive Algorithms Next time: Litterature: slides mostly The first Algorithm desig methods:

More information

Throughput-Delay Scaling in Wireless Networks with Constant-Size Packets

Throughput-Delay Scaling in Wireless Networks with Constant-Size Packets Throughput-Delay Scalig i Wireless Networks with Costat-Size Packets Abbas El Gamal, James Mamme, Balaji Prabhakar, Devavrat Shah Departmets of EE ad CS Staford Uiversity, CA 94305 Email: {abbas, jmamme,

More information

1.2 Binomial Coefficients and Subsets

1.2 Binomial Coefficients and Subsets 1.2. BINOMIAL COEFFICIENTS AND SUBSETS 13 1.2 Biomial Coefficiets ad Subsets 1.2-1 The loop below is part of a program to determie the umber of triagles formed by poits i the plae. for i =1 to for j =

More information

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence

9.1. Sequences and Series. Sequences. What you should learn. Why you should learn it. Definition of Sequence _9.qxd // : AM Page Chapter 9 Sequeces, Series, ad Probability 9. Sequeces ad Series What you should lear Use sequece otatio to write the terms of sequeces. Use factorial otatio. Use summatio otatio to

More information

Graphs. Minimum Spanning Trees. Slides by Rose Hoberman (CMU)

Graphs. Minimum Spanning Trees. Slides by Rose Hoberman (CMU) Graphs Miimum Spaig Trees Slides by Rose Hoberma (CMU) Problem: Layig Telephoe Wire Cetral office 2 Wirig: Naïve Approach Cetral office Expesive! 3 Wirig: Better Approach Cetral office Miimize the total

More information

Ones Assignment Method for Solving Traveling Salesman Problem

Ones Assignment Method for Solving Traveling Salesman Problem Joural of mathematics ad computer sciece 0 (0), 58-65 Oes Assigmet Method for Solvig Travelig Salesma Problem Hadi Basirzadeh Departmet of Mathematics, Shahid Chamra Uiversity, Ahvaz, Ira Article history:

More information

NTH, GEOMETRIC, AND TELESCOPING TEST

NTH, GEOMETRIC, AND TELESCOPING TEST NTH, GEOMETRIC, AND TELESCOPING TEST Sectio 9. Calculus BC AP/Dual, Revised 08 viet.dag@humbleisd.et /4/08 0:0 PM 9.: th, Geometric, ad Telescopig Test SUMMARY OF TESTS FOR SERIES Lookig at the first few

More information

Ch 9.3 Geometric Sequences and Series Lessons

Ch 9.3 Geometric Sequences and Series Lessons Ch 9.3 Geometric Sequeces ad Series Lessos SKILLS OBJECTIVES Recogize a geometric sequece. Fid the geeral, th term of a geometric sequece. Evaluate a fiite geometric series. Evaluate a ifiite geometric

More information

Data Structures and Algorithms. Analysis of Algorithms

Data Structures and Algorithms. Analysis of Algorithms Data Structures ad Algorithms Aalysis of Algorithms Outlie Ruig time Pseudo-code Big-oh otatio Big-theta otatio Big-omega otatio Asymptotic algorithm aalysis Aalysis of Algorithms Iput Algorithm Output

More information

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved.

Chapter 11. Friends, Overloaded Operators, and Arrays in Classes. Copyright 2014 Pearson Addison-Wesley. All rights reserved. Chapter 11 Frieds, Overloaded Operators, ad Arrays i Classes Copyright 2014 Pearso Addiso-Wesley. All rights reserved. Overview 11.1 Fried Fuctios 11.2 Overloadig Operators 11.3 Arrays ad Classes 11.4

More information

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions:

Solution printed. Do not start the test until instructed to do so! CS 2604 Data Structures Midterm Spring, Instructions: CS 604 Data Structures Midterm Sprig, 00 VIRG INIA POLYTECHNIC INSTITUTE AND STATE U T PROSI M UNI VERSI TY Istructios: Prit your ame i the space provided below. This examiatio is closed book ad closed

More information

CS200: Hash Tables. Prichard Ch CS200 - Hash Tables 1

CS200: Hash Tables. Prichard Ch CS200 - Hash Tables 1 CS200: Hash Tables Prichard Ch. 13.2 CS200 - Hash Tables 1 Table Implemetatios: average cases Search Add Remove Sorted array-based Usorted array-based Balaced Search Trees O(log ) O() O() O() O(1) O()

More information

Lower Bounds for Sorting

Lower Bounds for Sorting Liear Sortig Topics Covered: Lower Bouds for Sortig Coutig Sort Radix Sort Bucket Sort Lower Bouds for Sortig Compariso vs. o-compariso sortig Decisio tree model Worst case lower boud Compariso Sortig

More information

. Written in factored form it is easy to see that the roots are 2, 2, i,

. Written in factored form it is easy to see that the roots are 2, 2, i, CMPS A Itroductio to Programmig Programmig Assigmet 4 I this assigmet you will write a java program that determies the real roots of a polyomial that lie withi a specified rage. Recall that the roots (or

More information

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs

What are we going to learn? CSC Data Structures Analysis of Algorithms. Overview. Algorithm, and Inputs What are we goig to lear? CSC316-003 Data Structures Aalysis of Algorithms Computer Sciece North Carolia State Uiversity Need to say that some algorithms are better tha others Criteria for evaluatio Structure

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe CHAPTER 18 Strategies for Query Processig Copyright 2016 Ramez Elmasri ad Shamkat B. Navathe Itroductio DBMS techiques to process a query Scaer idetifies

More information

Data Structures Week #5. Trees (Ağaçlar)

Data Structures Week #5. Trees (Ağaçlar) Data Structures Week #5 Trees Ağaçlar) Trees Ağaçlar) Toros Gökarı Avrupa Gökarı October 28, 2014 Boraha Tümer, Ph.D. 2 Trees Ağaçlar) October 28, 2014 Boraha Tümer, Ph.D. 3 Outlie Trees Deiitios Implemetatio

More information

Random Graphs and Complex Networks T

Random Graphs and Complex Networks T Radom Graphs ad Complex Networks T-79.7003 Charalampos E. Tsourakakis Aalto Uiversity Lecture 3 7 September 013 Aoucemet Homework 1 is out, due i two weeks from ow. Exercises: Probabilistic iequalities

More information

Heaps. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015

Heaps. Presentation for use with the textbook Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015 Presetatio for use with the textbook Algorithm Desig ad Applicatios, by M. T. Goodrich ad R. Tamassia, Wiley, 201 Heaps 201 Goodrich ad Tamassia xkcd. http://xkcd.com/83/. Tree. Used with permissio uder

More information

Computational Geometry

Computational Geometry Computatioal Geometry Chapter 4 Liear programmig Duality Smallest eclosig disk O the Ageda Liear Programmig Slides courtesy of Craig Gotsma 4. 4. Liear Programmig - Example Defie: (amout amout cosumed

More information

EE123 Digital Signal Processing

EE123 Digital Signal Processing Last Time EE Digital Sigal Processig Lecture 7 Block Covolutio, Overlap ad Add, FFT Discrete Fourier Trasform Properties of the Liear covolutio through circular Today Liear covolutio with Overlap ad add

More information

A graphical view of big-o notation. c*g(n) f(n) f(n) = O(g(n))

A graphical view of big-o notation. c*g(n) f(n) f(n) = O(g(n)) ca see that time required to search/sort grows with size of We How do space/time eeds of program grow with iput size? iput. time: cout umber of operatios as fuctio of iput Executio size operatio Assigmet:

More information

Improved Random Graph Isomorphism

Improved Random Graph Isomorphism Improved Radom Graph Isomorphism Tomek Czajka Gopal Paduraga Abstract Caoical labelig of a graph cosists of assigig a uique label to each vertex such that the labels are ivariat uder isomorphism. Such

More information

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Running Time. Analysis of Algorithms. Experimental Studies. Limitations of Experiments Ruig Time Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Most algorithms trasform iput objects ito output objects. The

More information

SECURITY PROOF FOR SHENGBAO WANG S IDENTITY-BASED ENCRYPTION SCHEME

SECURITY PROOF FOR SHENGBAO WANG S IDENTITY-BASED ENCRYPTION SCHEME SCURITY PROOF FOR SNGBAO WANG S IDNTITY-BASD NCRYPTION SCM Suder Lal ad Priyam Sharma Derpartmet of Mathematics, Dr. B.R.A.(Agra), Uiversity, Agra-800(UP), Idia. -mail- suder_lal@rediffmail.com, priyam_sharma.ibs@rediffmail.com

More information

Fast Fourier Transform (FFT) Algorithms

Fast Fourier Transform (FFT) Algorithms Fast Fourier Trasform FFT Algorithms Relatio to the z-trasform elsewhere, ozero, z x z X x [ ] 2 ~ elsewhere,, ~ e j x X x x π j e z z X X π 2 ~ The DFS X represets evely spaced samples of the z- trasform

More information

2. ALGORITHM ANALYSIS

2. ALGORITHM ANALYSIS 2. ALGORITHM ANALYSIS computatioal tractability survey of commo ruig times 2. ALGORITHM ANALYSIS computatioal tractability survey of commo ruig times Lecture slides by Kevi Waye Copyright 2005 Pearso-Addiso

More information

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments

Running Time ( 3.1) Analysis of Algorithms. Experimental Studies. Limitations of Experiments Ruig Time ( 3.1) Aalysis of Algorithms Iput Algorithm Output A algorithm is a step- by- step procedure for solvig a problem i a fiite amout of time. Most algorithms trasform iput objects ito output objects.

More information

Analysis of Algorithms

Analysis of Algorithms Aalysis of Algorithms Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite amout of time. Ruig Time Most algorithms trasform iput objects ito output objects. The

More information

Elementary Educational Computer

Elementary Educational Computer Chapter 5 Elemetary Educatioal Computer. Geeral structure of the Elemetary Educatioal Computer (EEC) The EEC coforms to the 5 uits structure defied by vo Neuma's model (.) All uits are preseted i a simplified

More information

Computers and Scientific Thinking

Computers and Scientific Thinking Computers ad Scietific Thikig David Reed, Creighto Uiversity Chapter 15 JavaScript Strigs 1 Strigs as Objects so far, your iteractive Web pages have maipulated strigs i simple ways use text box to iput

More information

Exact Minimum Lower Bound Algorithm for Traveling Salesman Problem

Exact Minimum Lower Bound Algorithm for Traveling Salesman Problem Exact Miimum Lower Boud Algorithm for Travelig Salesma Problem Mohamed Eleiche GeoTiba Systems mohamed.eleiche@gmail.com Abstract The miimum-travel-cost algorithm is a dyamic programmig algorithm to compute

More information

Sorting 9/15/2009. Sorting Problem. Insertion Sort: Soundness. Insertion Sort. Insertion Sort: Running Time. Insertion Sort: Soundness

Sorting 9/15/2009. Sorting Problem. Insertion Sort: Soundness. Insertion Sort. Insertion Sort: Running Time. Insertion Sort: Soundness 9/5/009 Algorithms Sortig 3- Sortig Sortig Problem The Sortig Problem Istace: A sequece of umbers Objective: A permutatio (reorderig) such that a ' K a' a, K,a a ', K, a' of the iput sequece The umbers

More information

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 1. Introduction to Computers and C++ Programming. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 1 Itroductio to Computers ad C++ Programmig Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 1.1 Computer Systems 1.2 Programmig ad Problem Solvig 1.3 Itroductio to C++ 1.4 Testig

More information

Order statistics. Order Statistics. Randomized divide-andconquer. Example. CS Spring 2006

Order statistics. Order Statistics. Randomized divide-andconquer. Example. CS Spring 2006 406 CS 5633 -- Sprig 006 Order Statistics Carola We Slides courtesy of Charles Leiserso with small chages by Carola We CS 5633 Aalysis of Algorithms 406 Order statistics Select the ith smallest of elemets

More information

CSE 2320 Notes 8: Sorting. (Last updated 10/3/18 7:16 PM) Idea: Take an unsorted (sub)array and partition into two subarrays such that.

CSE 2320 Notes 8: Sorting. (Last updated 10/3/18 7:16 PM) Idea: Take an unsorted (sub)array and partition into two subarrays such that. CSE Notes 8: Sortig (Last updated //8 7:6 PM) CLRS 7.-7., 9., 8.-8. 8.A. QUICKSORT Cocepts Idea: Take a usorted (sub)array ad partitio ito two subarrays such that p q r x y z x y y z Pivot Customarily,

More information

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming

Lecture Notes 6 Introduction to algorithm analysis CSS 501 Data Structures and Object-Oriented Programming Lecture Notes 6 Itroductio to algorithm aalysis CSS 501 Data Structures ad Object-Orieted Programmig Readig for this lecture: Carrao, Chapter 10 To be covered i this lecture: Itroductio to algorithm aalysis

More information

The number n of subintervals times the length h of subintervals gives length of interval (b-a).

The number n of subintervals times the length h of subintervals gives length of interval (b-a). Simulator with MadMath Kit: Riema Sums (Teacher s pages) I your kit: 1. GeoGebra file: Ready-to-use projector sized simulator: RiemaSumMM.ggb 2. RiemaSumMM.pdf (this file) ad RiemaSumMMEd.pdf (educator's

More information

of types having a total order and a predecessor and a successor function. In the

of types having a total order and a predecessor and a successor function. In the J. Fuctioal Programmig 1 (1): 1{000, Jauary 1993 c 1993 Cambridge Uiversity Press 1 F U N C T I O N A L P E A R L S Diets for Fat Sets Marti Erwig FerUiversitat Hage, Praktische Iformatik IV 58084 Hage,

More information

Data Structures Week #9. Sorting

Data Structures Week #9. Sorting Data Structures Week #9 Sortig Outlie Motivatio Types of Sortig Elemetary (O( 2 )) Sortig Techiques Other (O(*log())) Sortig Techiques 21.Aralık.2010 Boraha Tümer, Ph.D. 2 Sortig 21.Aralık.2010 Boraha

More information

3D Model Retrieval Method Based on Sample Prediction

3D Model Retrieval Method Based on Sample Prediction 20 Iteratioal Coferece o Computer Commuicatio ad Maagemet Proc.of CSIT vol.5 (20) (20) IACSIT Press, Sigapore 3D Model Retrieval Method Based o Sample Predictio Qigche Zhag, Ya Tag* School of Computer

More information

Analysis of Algorithms

Analysis of Algorithms Aalysis of Algorithms Ruig Time of a algorithm Ruig Time Upper Bouds Lower Bouds Examples Mathematical facts Iput Algorithm Output A algorithm is a step-by-step procedure for solvig a problem i a fiite

More information

CSE 417: Algorithms and Computational Complexity

CSE 417: Algorithms and Computational Complexity Time CSE 47: Algorithms ad Computatioal Readig assigmet Read Chapter of The ALGORITHM Desig Maual Aalysis & Sortig Autum 00 Paul Beame aalysis Problem size Worst-case complexity: max # steps algorithm

More information

Algorithm Design Techniques. Divide and conquer Problem

Algorithm Design Techniques. Divide and conquer Problem Algorithm Desig Techiques Divide ad coquer Problem Divide ad Coquer Algorithms Divide ad Coquer algorithm desig works o the priciple of dividig the give problem ito smaller sub problems which are similar

More information

3. b. Present a combinatorial argument that for all positive integers n : : 2 n

3. b. Present a combinatorial argument that for all positive integers n : : 2 n . b. Preset a combiatorial argumet that for all positive itegers : : Cosider two distict sets A ad B each of size. Sice they are distict, the cardiality of A B is. The umber of ways of choosig a pair of

More information

condition w i B i S maximum u i

condition w i B i S maximum u i ecture 10 Dyamic Programmig 10.1 Kapsack Problem November 1, 2004 ecturer: Kamal Jai Notes: Tobias Holgers We are give a set of items U = {a 1, a 2,..., a }. Each item has a weight w i Z + ad a utility

More information

DATA STRUCTURES. amortized analysis binomial heaps Fibonacci heaps union-find. Data structures. Appetizer. Appetizer

DATA STRUCTURES. amortized analysis binomial heaps Fibonacci heaps union-find. Data structures. Appetizer. Appetizer Data structures DATA STRUCTURES Static problems. Give a iput, produce a output. Ex. Sortig, FFT, edit distace, shortest paths, MST, max-flow,... amortized aalysis biomial heaps Fiboacci heaps uio-fid Dyamic

More information

Thompson s Group F (p + 1) is not Minimally Almost Convex

Thompson s Group F (p + 1) is not Minimally Almost Convex Thompso s Group F (p + ) is ot Miimally Almost Covex Claire Wladis Thompso s Group F (p + ). A Descriptio of F (p + ) Thompso s group F (p + ) ca be defied as the group of piecewiseliear orietatio-preservig

More information

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved.

Chapter 9. Pointers and Dynamic Arrays. Copyright 2015 Pearson Education, Ltd.. All rights reserved. Chapter 9 Poiters ad Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Overview 9.1 Poiters 9.2 Dyamic Arrays Copyright 2015 Pearso Educatio, Ltd.. All rights reserved. Slide 9-3

More information

Chapter 3 Classification of FFT Processor Algorithms

Chapter 3 Classification of FFT Processor Algorithms Chapter Classificatio of FFT Processor Algorithms The computatioal complexity of the Discrete Fourier trasform (DFT) is very high. It requires () 2 complex multiplicatios ad () complex additios [5]. As

More information

COMP Parallel Computing. PRAM (1): The PRAM model and complexity measures

COMP Parallel Computing. PRAM (1): The PRAM model and complexity measures COMP 633 - Parallel Computig Lecture 2 August 24, 2017 : The PRAM model ad complexity measures 1 First class summary This course is about parallel computig to achieve high-er performace o idividual problems

More information

6.851: Advanced Data Structures Spring Lecture 17 April 24

6.851: Advanced Data Structures Spring Lecture 17 April 24 6.851: Advaced Data Structures Sprig 2012 Prof. Erik Demaie Lecture 17 April 24 Scribes: David Bejami(2012), Li Fei(2012), Yuzhi Zheg(2012),Morteza Zadimoghaddam(2010), Aaro Berstei(2007) 1 Overview Up

More information

Minimum Spanning Trees

Minimum Spanning Trees Miimum Spaig Trees Miimum Spaig Trees Spaig subgraph Subgraph of a graph G cotaiig all the vertices of G Spaig tree Spaig subgraph that is itself a (free) tree Miimum spaig tree (MST) Spaig tree of a weighted

More information

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method

A New Morphological 3D Shape Decomposition: Grayscale Interframe Interpolation Method A ew Morphological 3D Shape Decompositio: Grayscale Iterframe Iterpolatio Method D.. Vizireau Politehica Uiversity Bucharest, Romaia ae@comm.pub.ro R. M. Udrea Politehica Uiversity Bucharest, Romaia mihea@comm.pub.ro

More information

FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS

FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS FREQUENCY ESTIMATION OF INTERNET PACKET STREAMS WITH LIMITED SPACE: UPPER AND LOWER BOUNDS Prosejit Bose Evagelos Kraakis Pat Mori Yihui Tag School of Computer Sciece, Carleto Uiversity {jit,kraakis,mori,y

More information

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0

Polynomial Functions and Models. Learning Objectives. Polynomials. P (x) = a n x n + a n 1 x n a 1 x + a 0, a n 0 Polyomial Fuctios ad Models 1 Learig Objectives 1. Idetify polyomial fuctios ad their degree 2. Graph polyomial fuctios usig trasformatios 3. Idetify the real zeros of a polyomial fuctio ad their multiplicity

More information

Fundamentals of Media Processing. Shin'ichi Satoh Kazuya Kodama Hiroshi Mo Duy-Dinh Le

Fundamentals of Media Processing. Shin'ichi Satoh Kazuya Kodama Hiroshi Mo Duy-Dinh Le Fudametals of Media Processig Shi'ichi Satoh Kazuya Kodama Hiroshi Mo Duy-Dih Le Today's topics Noparametric Methods Parze Widow k-nearest Neighbor Estimatio Clusterig Techiques k-meas Agglomerative Hierarchical

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 6 Defiig Fuctios Pytho Programmig, 2/e 1 Objectives To uderstad why programmers divide programs up ito sets of cooperatig fuctios. To be able to

More information

CMPT 125 Assignment 2 Solutions

CMPT 125 Assignment 2 Solutions CMPT 25 Assigmet 2 Solutios Questio (20 marks total) a) Let s cosider a iteger array of size 0. (0 marks, each part is 2 marks) it a[0]; I. How would you assig a poiter, called pa, to store the address

More information

Priority Queues. Binary Heaps

Priority Queues. Binary Heaps Priority Queues Biary Heaps Priority Queues Priority: some property of a object that allows it to be prioritized with respect to other objects of the same type Mi Priority Queue: homogeeous collectio of

More information

Numerical Methods Lecture 6 - Curve Fitting Techniques

Numerical Methods Lecture 6 - Curve Fitting Techniques Numerical Methods Lecture 6 - Curve Fittig Techiques Topics motivatio iterpolatio liear regressio higher order polyomial form expoetial form Curve fittig - motivatio For root fidig, we used a give fuctio

More information

An Improved Shuffled Frog-Leaping Algorithm for Knapsack Problem

An Improved Shuffled Frog-Leaping Algorithm for Knapsack Problem A Improved Shuffled Frog-Leapig Algorithm for Kapsack Problem Zhoufag Li, Ya Zhou, ad Peg Cheg School of Iformatio Sciece ad Egieerig Hea Uiversity of Techology ZhegZhou, Chia lzhf1978@126.com Abstract.

More information

Xiaozhou (Steve) Li, Atri Rudra, Ram Swaminathan. HP Laboratories HPL Keyword(s): graph coloring; hardness of approximation

Xiaozhou (Steve) Li, Atri Rudra, Ram Swaminathan. HP Laboratories HPL Keyword(s): graph coloring; hardness of approximation Flexible Colorig Xiaozhou (Steve) Li, Atri Rudra, Ram Swamiatha HP Laboratories HPL-2010-177 Keyword(s): graph colorig; hardess of approximatio Abstract: Motivated b y reliability cosideratios i data deduplicatio

More information

the beginning of the program in order for it to work correctly. Similarly, a Confirm

the beginning of the program in order for it to work correctly. Similarly, a Confirm I our sytax, a Assume statemet will be used to record what must be true at the begiig of the program i order for it to work correctly. Similarly, a Cofirm statemet is used to record what should be true

More information

The Adjacency Matrix and The nth Eigenvalue

The Adjacency Matrix and The nth Eigenvalue Spectral Graph Theory Lecture 3 The Adjacecy Matrix ad The th Eigevalue Daiel A. Spielma September 5, 2012 3.1 About these otes These otes are ot ecessarily a accurate represetatio of what happeed i class.

More information

Evaluation scheme for Tracking in AMI

Evaluation scheme for Tracking in AMI A M I C o m m u i c a t i o A U G M E N T E D M U L T I - P A R T Y I N T E R A C T I O N http://www.amiproject.org/ Evaluatio scheme for Trackig i AMI S. Schreiber a D. Gatica-Perez b AMI WP4 Trackig:

More information

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup Note:

Abstract. Chapter 4 Computation. Overview 8/13/18. Bjarne Stroustrup   Note: Chapter 4 Computatio Bjare Stroustrup www.stroustrup.com/programmig Abstract Today, I ll preset the basics of computatio. I particular, we ll discuss expressios, how to iterate over a series of values

More information

Analysis of Algorithms

Analysis of Algorithms Presetatio for use with the textbook, Algorithm Desig ad Applicatios, by M. T. Goodrich ad R. Tamassia, Wiley, 2015 Aalysis of Algorithms Iput 2015 Goodrich ad Tamassia Algorithm Aalysis of Algorithms

More information

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1

COSC 1P03. Ch 7 Recursion. Introduction to Data Structures 8.1 COSC 1P03 Ch 7 Recursio Itroductio to Data Structures 8.1 COSC 1P03 Recursio Recursio I Mathematics factorial Fiboacci umbers defie ifiite set with fiite defiitio I Computer Sciece sytax rules fiite defiitio,

More information

Python Programming: An Introduction to Computer Science

Python Programming: An Introduction to Computer Science Pytho Programmig: A Itroductio to Computer Sciece Chapter 1 Computers ad Programs 1 Objectives To uderstad the respective roles of hardware ad software i a computig system. To lear what computer scietists

More information

Recursive Estimation

Recursive Estimation Recursive Estimatio Raffaello D Adrea Sprig 2 Problem Set: Probability Review Last updated: February 28, 2 Notes: Notatio: Uless otherwise oted, x, y, ad z deote radom variables, f x (x) (or the short

More information

On (K t e)-saturated Graphs

On (K t e)-saturated Graphs Noame mauscript No. (will be iserted by the editor O (K t e-saturated Graphs Jessica Fuller Roald J. Gould the date of receipt ad acceptace should be iserted later Abstract Give a graph H, we say a graph

More information

Design and Analysis of Algorithms Notes

Design and Analysis of Algorithms Notes Desig ad Aalysis of Algorithms Notes Notes by Wist Course taught by Dr. K Amer Course started: Jauary 4, 013 Course eded: December 13, 01 Curret geeratio: December 18, 013 Listigs 1 Array sum pseudocode.................................

More information

A Dynamic Separator Algorithm

A Dynamic Separator Algorithm A Dyamic Separator Algorithm Degait Armo Joh Reif Departmet of Computer Sciece, Duke Uiversity Durham, NC 27708-0129 Abstract Our work is based o the pioeerig work i sphere separators doe by Miller, Teg,

More information