A Polylog Time Wait-Free Construction for Closed Objects

Size: px
Start display at page:

Download "A Polylog Time Wait-Free Construction for Closed Objects"

Transcription

1 A Polylog Tme Wat-Free Constructon for Closed Obects Tusar Deepak Candra Prasad Jayant Kng Tan IBM T.J.Watson Researc Center Dartmout College Dartmout College Abstract A (wat-free) unversal constructon s attractve because, no matter wat types of wat-free obects are needed by applcatons, tey can be mplemented smply by nstantatng te unversal constructon wt te approprate types. However, te worst-case tme complexty of every exstng n-process unversal constructon s Ω(n): tat s, n any mplementaton obtaned by nstantatng a unversal constructon, n te worst-case a process performs Ω(n) computaton n order to complete a sngle operaton on te mplemented obect. In fact, a lower bound of Ω(n) as been proved for te worst-case local tme complexty of any oblvous unversal constructon []. Snce unversal constructons wt sublnear tme complexty do not seem possble, t s natural to explore semunversal constructons tat can effcently mplement large classes of obects (as opposed to all obects). We present suc a constructon n ts paper. Our constructon mplements a large class of obects, tat we call closed obects. Ts class ncludes several common syncronzaton obects, suc as swap, fetc&add, fetc&multply, and fetc&φ (were Φ s any of te boolean operatons and, or, or complement). Our constructon aceves worst-case saredaccess tme and local tme complexty of O(log n). Furter, at low contenton, te tme complexty s even lower. Te constructon assumes tat te underlyng sared-memory supports LL and SC operatons. To te best of our knowledge, f we consder constructons tat can mplement a class of obects (as opposed to a specfc obect), ts s te frst tme tat te polynomal barrer as been broken for te worst-case tme complexty. Fnally, Jayant proves a Ω(log n) lower bound on te worst-case sared-access tme complexty of any mplementaton of certan closed obects []. Tus, te O(log n) worst-case sared-access tme complexty aceved n ts paper s wtn a logartmc factor of te optmum. Ts work s partally supported by NSF RIA grant CCR- 90. Introducton A wat-free mplementaton of a sared obect guarantees tat f a process repeatedly takes steps, ten ts operaton on te mplemented sared obect wll eventually complete, regardless of weter oter processes are slow, fast, or ave crased. Wat-free mplementatons are free of te ptfalls, suc as convoyng, prorty nverson, and deadlocks, tat afflct lock-based mplementatons. However, wat-free mplementatons are notorously ard to desgn and prove correct. To overcome ts dffculty, recent researc as focussed on unversal constructons [,,,, 6,, 8, 9, 0,,, 9, 0,, ] A unversal constructon for n processes s an algortm tat, wen nstantated wt te sequental mplementaton of any type T, becomes a wat-free mplementaton of a type T obect tat can be accessed concurrently by n processes [9]. Tus, once we ave an effcent unversal constructon U, any sared obect can be mplemented smply by nstantatng U approprately. Unfortunately, te worst-case tme complexty of every exstng unversal constructon s Ω(n). In fact, t appears tat Ω(n) s an nerent lmtaton of any unversal constructon: To complete one operaton on any sared obect mplemented from any oblvous unversal constructon, n te worst-case a process must perform Ω(n) local computaton []. (A unversal constructon s oblvous f t does not explot te semantcs of te type tat t s nstantated wt.) Snce unversal constructons wt sublnear tme complexty do not seem possble, t s natural to explore semunversal constructons tat can effcently mplement large classes of obects (as opposed to all obects). We present suc a constructon n ts paper. Our constructon can mplement a large class of obects, tat we call closed obects. Ts class ncludes several common syncronzaton obects, suc as swap, fetc&add, and fetc&φ (were Φ s any of te boolean operatons and, or, or complement). Our constructon aceves a worst-case tme complexty of O(log n). Furter, f an operaton op experences low contenton (.e., te actual number of processes tat ave operatons concurrent wt op s small), ts runnng tme s even smaller. In te rest of te ntroducton, we gve a precse statement of our result after ntroducng te relevant termnology. A sequental mplementaton requres tat operatons be appled one after anoter, wtout overlap.

2 . Closed type: Defnton and examples An obect type T s a tuple (OP,RES, Q, δ state, δ resp), were OP s a set of operatons, RES s a set of responses, Q s a set of states, δ state : Q OP Q s a state transton functon, and δ resp : Q OP RES s a response functon. Informally, f δ state(s, op) = s and δ resp(s, op) = res, applyng operaton op to an obect n state s causes te obect to move to state s and return te response res. T s closed f, for all ordered pars (op, op ) OP OP, tere exsts op OP suc tat for all s Q we ave δ state(s, op) = δ state(δ state(s, op ), op ). Tat s, from any state s, applyng op results n te same state as frst applyng op and ten applyng op. We assume tat combneoperatons(op, op ) returns op. We restrct our focus to closed types for wc te functons δ state, δ resp, and combne-operatons can be computed n O() tme, and a state or an operaton can be stored n a small constant number of macne words. Type T = (OP, RES, Q, δ state, δ resp) s a super type of T = (OP, RES, Q, δ state, δ resp) f OP OP, RES RES, Q Q and, for all (s, op) Q OP, δ state(s, op) = δ state(s, op) and δ response(s, op) = δ response(s, op). A type T = (OP, RES, Q, δ state, δ resp) s closable f t as a closed super type T = (OP, RES, Q, δ state, δ resp); operatons n OP OP are closng operatons of T. Notce tat wenever a sared obect of a closable type T s desred, one can nstead mplement (usng te constructon presented n ts paper) a sared obect of a closed super type of T. Te followng are many examples of closed or closable types []:. Obect supportng fetc&add (F&A), read, and wrte: F&A(a) and F&A(b) combne to F&A(a + b); F&A(a) and wrte(b) combne to wrte(b); wrte(a) and F&A(b) combne to wrte(a + b); F&A(a) and read combne to F&A(a); wrte(a) and read combne to wrte(a).. Obect supportng swap and read: swap(a) and swap(b) combne to swap(b); swap(a) and read combne to swap(a). Snce test&set s a specal case of swap, test&set s also a closed type.. Obect supportng read and all operatons n te famly fetc&φ, were Φ s any boolean operaton and, or, or complement. For example, f te obect s a 6-bt word, fetc&or takes a 6-bt argument, or s t wt te value of te obect, stores te new value n te obect and returns te old value. To close ts type, we add te closng operaton closng-op(a,b, f), were te arguments a and b are of te sze of te obect and f s a boolean. If x s te current state of te obect, applyng closng-op(a, b, f) canges te state as follows: f f s false, te new state s (a x) b; f f s true, te new state s (a x) b. From ts defnton, we see tat closng-op(a,b, f) and fetc&and(c) combne to closng-op(a c, b c, f); closng-op(a, b, f) and fetc&or(c) combne to closng-op(a, b c, f); closng-op(a,b, f) and fetc&complement combne to closng-op(b, a b, f).. Obect supportng all of read, swap (notce tat swap s more general tan wrte), fetc&add and fetc&multply. Here agan we close te obect by addng an operaton closng-op(a,b) wc, wen appled to an obect n state x, canges te state to ax + b.. Obect wose state conssts of a par of values (x, y) and supports te followng operatons (for eac operaton, te state mmedately before te operaton s assumed to be (x, y)): move canges state to (x, x), move canges state to (y, y), swap canges state to (y, x), wrte (z) canges state to (z, y), wrte (z) canges state to (x, z), wrte(z, z ) canges state to (z,z ), and read returns (x, y). As n Example, we need to add a closng operaton to close te obect. Unlke prevous examples, ts type s unversal [9, ]. Tus, tere s a lot of varety among closed types: tere are commutatve, overwrtng, non-commutatve and nonoverwrtng, and unversal types. Furter, as te examples ave sown, ts class ncludes many commonly used syncronzaton obects. Our constructon mplements all of tese n polylog tme.. Tme complexty measures In a wat-free mplementaton of obect O from obects O, O,... (we call O, O,... base obects), eac operaton on O s mplemented by some sequence of operatons on te base obects, along wt some local computaton. We assocate two tme complexty measures wt an operaton op of a process P on O. Te sared-accesstme complexty of op s te total number of operatons tat P performs on te base obects n order to complete op. Te local tme complexty of op s te total number of local computaton steps tat P performs n order to complete op. Te worst-case saredaccess (resp., local) tme complexty s te maxmum, over all operatons op and runs R, of sared-access tme (resp., local tme) complexty of op n R.. Contenton-senstve tme complexty Te contenton experenced by op, denoted by n c, s te number of processes tat ave operatons concurrent wt op. Ideally, f an operaton experences low contenton (.e., n c << n), ts tme complexty sould be smaller tan te worst-case tme complexty []. More precsely, te tme complexty of an operaton sould be a functon of n c, not of n. Afek, Dauber, and Toutou defned and aceved ts property n ter unversal constructon [].. Te result and ts sgnfcance We present an n-process constructon tat, wen nstantated wt a sequental mplementaton of any closed type T, yelds a wat-free mplementaton of an obect of type T tat can be accessed concurrently by a maxmum of n processes. Te sared-access and local tme complextes of an operaton (on te mplemented obect) are bot O(mn(n c,log n)), were n c s te contenton experenced by te operaton. Te tme complexty grows lnearly wt contenton, but s never more tan O(log n). Tus, ts combnes te benefts of contenton-senstve tme complexty wt a guaranteed small worst-case tme complexty. Ts feature, togeter wt te fact tat closed types nclude several useful syncronzaton obects, makes te constructon useful. Our constructon assumes tat te underlyng saredmemory supports load-lnk (LL) and store-condtonal (SC) operatons. Snce closed types nclude unversal types (see Example above), any constructon tat s unversal for closed types s necessarly based on unversal operatons, suc as LL and SC. To te best of our knowledge, f we consder constructons tat can mplement a class of obects (as opposed to a specfc obect), ts s te frst tme tat te polynomal barrer as been broken for te worst-case tme complexty. Jayant proves a lower bound of Ω(log n) on te saredaccess tme complexty of any mplementaton of a class

3 of types tat ncludes fetc&add, fetc&multply, and fetc&and (from LL and SC) []. Tus, te sared-access tme complexty upper bound of O(log n) aceved n ts paper s wtn a logartmc factor of te optmal. Related Work Te noton of contenton-senstve tme complexty s due to Afek, Dauber, and Toutou [] wo, n ter unversal constructon, aceve ts property troug two novel deas: bnary tree based elpng and breadt-frst searc of te tree to capture a node close to te root. We employ tese deas n our constructon. Kruskal, Rudolf, and Snr descrbe ow operaton combnng, wen mplementng closed obects n ardware, reduces traffc on te nterconnecton network of multprocessors []. Te noton and te desgn of te frst unversal constructon are due to Herly [8, 9]. Te use of LL and SC n unversal constructons was also ntroduced by Herly [0]. Of te recent unversal constructons, some focus on mprovng te tme complexty wen concurrent operatons access dsont parts of te mplemented obect [,, 6,,, 9,, ]. Oters focus on reducng te worstcase tme complexty []. Afek, Wesberger, and Wesman present polynomal tme mplementatons of some obects at Level of te consensus erarcy, ncludng fetc&add and swap obects, from -consensus obects []. Some fast type-specfc mplementatons are known: examples nclude constant tme mplementatons of compare&swap from LL/SC, and vce versa [], O(w) mplementaton of w-word LL/SC/VL from one-word LL/SC/VL [], and O(w) mplementaton of w-word weakll/sc/vl from one-word compare&swap [8]. Informal descrpton of te constructon Ts secton provdes te ntuton for ow our constructon works. We develop te deas, te data structures, and nformally argue te correctness of te constructon.. Bnary tree prelmnares Let n be te number of processes n te system. We assume tat n s a power of. All trees consdered n ts secton are bnary trees and are of egt at most log n. We say a tree s fully formed f ts egt s exactly log n. We use te standard defnton tat a tree s complete f all leaves are at te same level and all nteror nodes ave two cldren. Below, we descrbe our sceme to number te nodes of a tree [6]. Frst, we descrbe te sceme for a complete, fully formed tree. Fgure (a) sows suc a tree for n =. We assgn te number to te root and number te remanng nodes breadt-frst. Te number assgned to a node s ts poston n te tree. Our numberng sceme causes te leaves to be at postons n, n+,..., n. In partcular, te Pt leaf (we consder te leftmost leaf to be te 0t leaf) s at poston n+p. Also, te parent of a node at poston s at poston /, and te left cld and te rgt cld of a node at poston are at postons and +, respectvely. Te above numberng sceme can be extended to fully formed trees tat are not complete. Fgure (b) presents suc a tree (assumng n = ). Te poston of a node n suc a tree s te number tat would be assgned to t f te tree were complete. Tus, te poston of te leaf n te example tree s 6. Fnally, consder a tree tat s not fully formed. For example, f n =, te tree n Fgure (c) s not fully formed. Snce tere are multple ways n wc suc a tree can be extended nto a fully formed tree, t s mpossble to determne te postons of te nodes wtout furter nformaton. However, f te poston of any one node s gven, te postons of oters can be easly determned. For example, f (for te tree n Fgure (c)) te rgtmost leaf s gven to be at poston, we can nfer tat ts parent s at poston and te oter leaf s at poston.. How operatons are represented Our data structure stores operaton cells n a sequence of bnary trees, wt fully formed trees followed by non-fully formed trees. Fgure (d) sows an example for n =. Here te frst tree trees are fully formed, wle te remanng ones are not. (Te number at a cell ndcates ts poston n te tree; te letter nsde a cell s te operaton stored n tat cell; and a black square nsde a cell denotes a nl ponter.) Recall tat n, n+,..., n are te leaf postons (n a complete, fully formed tree). In our constructon, te leaf at poston n + P of a tree, f t exsts, s assocated exclusvely wt process P (for all 0 P n : processes are numbered 0,,..., n ). In partcular, f a tree as a cell at poston n+p, tat cell was ntroduced nto te global structure by process P and t stores an operaton from process P. Tus, te frst tree (n Fgure (d)) contans operatons from all four processes operaton a from Process 0 (at poston ), operaton b from Process, and operatons c and d from processes and, respectvely. Te second tree contans only one operaton operaton e from Process (lookng at te sape of ts tree, we know tat te only leaf s at poston and ence contans an operaton from Process ). Te trd tree contans two operatons operaton f from Process 0 and operaton g from Process. Te fourt tree s not fully formed (snce ts egt s less tan log n). In fact, gven tat ts tree as only one cell so far, t would be normally mpossble to say wat te poston of ts cell s. Our constructon, owever, ensures tat eac tree grows bottom-up from leaves to te root. Tus, one can conclude tat te lone cell n te fourt tree wll eventually be a leaf (n a fully formed tree). As already mentoned, our constructon also ensures tat a leaf created by process P wll be at poston n+p of a fully formed tree. Tus, assumng tat te cell n te fourt tree was created by Process, we ndcated ts poston as (n a fully formed tree tat ts cell wll eventually be a part of). Te fnal tree n te fgure s also not fully formed. It contans one operaton operaton from Process.. How operatons are lnearzed In our constructon, an operaton takes effect te moment t becomes a part of a fully formed tree. Tus, n our example, operatons a troug g took effect, but operatons and dd not. Operatons tat took effect are lnearzed accordng to te followng rules: all operatons n a tree are lnearzed before any operaton n te next tree; operatons wtn a tree are lnearzed n te natural left to rgt order on te leaves. Tus, n our example, a, b, c, d, e, f, g s te lnearzaton order.

4 . Growng trees bottom-up In our constructon, wen a process P wses to apply an operaton op on te mplemented obect, P gets a cell from ts prvate pool of cells, stores op n te cell, and creates a tree out of ts sngle cell. (Te fourt tree n Fgure (d) s an example of suc a tree: ere Process as ust created a tree out of ts operaton cell.) P ten makes an effort to grow ts (sngle-celled) tree nto a fully formed tree (of egt log n) n wc ts operaton cell wll be a leaf at poston n + P. We already mentoned tat P s operaton takes effect only after ts operaton cell becomes a leaf of a fully formed tree. Snce a process returns from ts operaton only after te operaton takes effect, our constructon satsfes te followng property: Completon Rule: A process P returns from ts operaton only after ts operaton cell s a leaf (at poston n + P) of a fully formed tree. Our constructon also ensures tat a tree always grows bottom-up. Specfcally, te constructon satsfes te followng property: Bottom-up Rule: If C s a cell n a tree, ten te subtree rooted at C does not subsequently cange. For example, consder te fnal tree n Fgure (d). Te parent of te cell contanng operaton as no left cld. By te bottom-up rule, ts cell wll never get a left cld n te future. It s mmedate from te bottom-up rule tat a fully formed tree never subsequently canges: tere won t be any addton or removal of cells from a fully formed tree. Ts fact mples lnearzablty, as we argue now. Consder two operatons op and op suc tat op precedes op (.e., op returns before op s nvoked). By te completon rule, wen op s nvoked, op s already a leaf of a fully formed tree. Snce fully formed trees never subsequently cange, op becomes a leaf n a later tree. By our lnearzaton order, op s lnearzed before op. Hence we ave lnearzablty.. How a process makes progress To understand ow processes make progress, let us consder a specfc example: suppose tat Process 0 nvokes te operaton and runs alone from te confguraton depcted n Fgure (d). (In Fgures (e)-(g), we wll depct te sequence of canges to te confguraton. Snce te tree fully formed trees are a part of all of tese confguratons, we wll not repeat tem n tese fgures.) Process 0 creates a (sngle-celled) tree contanng ts operaton cell (Fgure (e)). Te next goal of Process 0 s to make ts operaton cell a leaf (at poston n+p = n) of a fully formed tree;.e., to get ts cell a parent (at poston (n + P)/ = n/), ten a grandparent (at poston (n + P)/ = n/), ten a parent for te grandparent and so on, untl ts operaton cell as log n ancestors. Tus, te mmedate subgoal s to get a parent for ts operaton cell (contanng te operaton ). Snce te parent wll be a cell at poston (n + P)/, wc n our example s, te parent can potentally ave two cldren: one at poston and anoter at poston. Terefore, Process 0 cecks f tere s already an unparented cell at poston and fnds te operaton cell contanng. So t creates a cell wose left and rgt cldren are te operaton cells contanng and, respectvely (Fgure (f)). Process 0 ten proceeds to get a parent (at poston ) for ts new cell. Snce a cell at poston can potentally ave cells at postons and as ts left and rgt cldren, t cecks f tere s an unparented cell at poston. Snce tere s suc a cell, t creates a cell at poston as sown n Fgure (g). At ts pont, te operaton of Process 0 as taken effect. So ave te operatons and of processes and : te steps of Process 0 ave elped tem take effect as well. Te above example also rougly suggests wy our sared-access and local tme complexty as a logartmc, rater tan lnear, dependence on n. To understand certan ntrcaces of our constructon, let us consder anoter example: a run, agan startng from te confguraton n Fgure (d), n wc te steps of Process 0 and Process nterleave. (We wll depct te sequence of canges to te confguraton n Fgures ()-(l).) Specfcally, te run s as follows: Process, wc as already announced ts operaton, proceeds to get a parent for ts operaton cell. Ts parent can potentally ave a cell at poston as ts left cld; owever, Process does not fnd an unparented cell at poston. So t creates a cell C wose left cld s nl and rgt cld s te operaton cell contanng (see Fgure ()). Process 0 announces a new operaton (Fgure ()). Process 0 proceeds to get a parent for ts operaton cell. Snce ts parent can potentally ave a cell at poston as ts rgt cld, t looks for an unparented cell at poston. Snce tere s no suc cell, t creates a cell C wose rgt cld s nl and left cld s ts operaton cell. Notce tat Cell C, lke Cell C, s a cell at poston. If we make t possble for Process 0 to nstall cell C nto te global structure, tere wll be two unparented cells at poston. Our constructon does not permt ts. Specfcally, our constructon satsfes te followng nvarant: At Most One Orpan Rule: Tere s at most one unparented cell n any poston at any tme. Accordngly, te attempt of Process 0 to nstall C nto te global structure wll fal. Suppose Process 0 s te only process alve. Clearly, because of At most one orpan rule and bottomup rule (descrbed earler), Process 0 wll not be able to get a parent for ts operaton cell untl C gets a parent. So Process 0 gets a parent for C, even toug ts operaton cell s not a descendent of C (see Fgure ()). Process 0 ten gets a parent for ts operaton cell (Fgure (k)) and ten a grandparent (Fgure (l)). At ts pont, ts operaton as taken effect..6 Data structures Conceptually, as already explaned, te prncpal global structure mantaned by our constructon s a sequence of trees. In ts secton, we descrbe ow ts conceptual global structure s actually represented n sared memory. We also

5 state te precse nvarants tat our data structures satsfy so as to respect te rules Bottom-up rule, At most one orpan rule etc. tat we motvated earler..6. Representng a sequence of trees Let Σ be a sequence of trees at some pont n a run (we wll use te sequence of trees n Fgure (d) as our example). In our constructon, Σ s represented usng n sngly lnked lsts. Te lsts are numbered,,..., n. Lst lst conssts of all cells at poston lst n te trees n Σ. Fgure (m) depcts te lsts for te sequence of trees n Fgure (d). Te parent-cld relatonsp wtn eac tree n Σ s preserved n te representaton by ncludng approprate left cld and rgt cld ponters between cells n dfferent lsts. For example, Fgure (m) depcts tese ponters correspondng to te trd tree n Fgure (d). (To keep te fgure uncluttered, te left cld and rgt cld ponters correspondng to te remanng trees are not sown.) Notce tat, f C s a cell n lst lst, eter C as no left cld or C s left cld s a cell n te lst numbered lst. Smlarly, eter C as no rgt cld or C s rgt cld s a cell n te lst numbered lst Te felds of a cell Te varous felds n eac cell are as follows: LC, RC, and Parent felds of a cell pont to te left cld, rgt cld, and parent of tat cell (f a cell as no left cld or rgt cld or parent, te correspondng feld as te value ). Next feld ponts to te next cell n te same lst (f a cell s te last one n a lst, ts Next feld as te value ). Op feld of a cell C contans a sngle operaton tat results from combnng te operatons at te leaves of te subtree rooted at C. For example, Op feld of te trd cell n lst contans te operaton tat f and g combne to. Op feld of te frst cell n lst contans te operaton tat c and d combne to, and Op feld of te frst cell n lst contans a. Lop feld of a cell C contans a sngle operaton tat results from combnng te operatons at te leaves of te left subtree of C (f C as no left cld, ten C s Lop feld as te value ). For example, Lop feld of te frst cell n lst contans te operaton tat a and b combne to, Lop feld of te frst cell n lst contans c, and Lop feld of te frst cell n lst contans. State feld of a cell C s useful for recordng te state tat results after all operatons at te leaves to te left of Cell C are appled, n te natural left-to-rgt order. (Leaves to te left of C are all te leaves, n all trees, tat are to te left of te leftmost leaf descendent of C.) For example, State feld of te trd cell n lst contans te state tat results after te operatons a, b, c, d, e, f are appled, n tat order. Fnally, eac cell as a Ready feld tat olds a boolean value. A value of false ndcates tat te cell s not yet ready to ave a parent, wle a value of true ndcates tat te cell s eager to ave a parent. Te motvaton for ncludng Ready feld s gven n te followng paragrap, were we explan ow ts feld elps satsfy te requrement tat trees be bult bottom-up. Our constructon s suc tat, once a cell C becomes a part of a tree, te values of ts LC and RC felds wll not subsequently cange. In oter words, f a cell C as a left cld (respectvely, rgt cld) D, ts LC (respectvely, RC) feld ponts to D rgt from te moment C becomes a part of te tree. However, t s only after C becomes a part of te tree tat D s Parent feld s set to C. So, after a cell C gets nto a tree, ts cldren s parent ponter wll need to be set to C. Snce we ws to buld trees bottom-up, te settng of te parent ponter of C s cldren must be completed before C gets a parent. We mplement ts by ensurng tat C s Ready feld ntally as false and tat t canges to true only after te parent ponters of C s cldren are set to C. Te gst of te last paragrap s summarzed by Invarants and, stated below. Te frst states tat a cell gets a parent only after t announces tself ready to ave one. Te second states tat a cell c announces tself ready (to ave a parent) only after ts cldren s parent feld s set to c. Ts nvarant captures te bottom-up buldng of trees. Invarant : For any cell c n any lst lst, c Parent mples c Ready = true. Invarant : For any cell c n any lst lst, f c Ready = true ten te followng old:. If c LC, ten c LC Parent = c.. If c RC, ten c RC Parent = c. We use te followng termnology. A cell s an orpan f ts Parent feld as ; oterwse t s parented or t as a parent. A ready orpan s an orpan wose Ready feld as true. A cell c as a ready parent f c as a parent wose Ready feld as true. Recall te At Most One Orpan rule, wc states tat tere s at most one orpan at eac poston. We capture ts wt te followng nvarant: Invarant : Eac lst as at most one orpan. If a lst as an orpan, t s te last cell n te lst..6. Te ead varables For eac lst lst, lst n, our constructon mantans a sared varable Head[lst] tat, rougly speakng, ponts to te last parented cell n lst lst. Te exact propertes of Head[lst] are expressed by te followng nvarant: Invarant : If te value of Head[lst] s c, ten te followng statements old:. c ponts to a parented cell n lst lst.. c ponts eter to te last cell or to te cell prevous to te last cell n lst lst.. If a cell D n lst lst as a ready parent, ten c ponts to D or beyond D n lst lst. Wt Invarants and, a process P can easly determne f lst lst as a ready orpan as follows:lst P reads te value of Head[lst] nto a local varable c; P ten reads c Next nto d; f d, d Ready as true and d Parent as, ten d s a ready orpan n lst lst.

6 . Understandng te constructon Our constructon s presented n Fgure and contnued n Fgure. We wll use top-down reasonng to argue tat te constructon s correct. Tus, f procedure A calls procedure B, we prove tat A satsfes ts stated propertes on te premse tat B satsfes ts propertes, and later prove te premse. We wll state te propertes of procedures as lemmas. It turns out tat lst s often a specal case. To not obscure te man ntuton, we wll owever omt references to suc specal cases n te statements of te lemmas below. A process P apples an operaton op on te mplementaton by executng te procedure apply(op). We argue te correctness of te response returned by apply on te premse tat promote and percolatestate satsfy followng propertes. Lemma (Property of promote) If, before promote(lst) s called, a cell c s a ready orpan n lst lst, ten after completng promote c as a ready parent. Lemma (Property of percolatestate) Suppose, before a call to percolatestate(c,n + P), c s a cell n lst n + P, c as an ancestor d n lst, and d State s te state obtaned by applyng operatons n trees tat are before c s tree. Ten, after te call completes, c State s te state obtaned by applyng operatons to te left of c tese are ()operatons n trees tat are before c s tree, and ()operatons to te left of c n c s tree. Wen process P calls apply(op), t frst executes announce(op). Durng ts procedure, P grabs a fres cell from ts prvate pool of cells, stores op n te Op feld, sets te Ready feld to true, and treads ts opcell to te end of lst n +P. P ten calls promote on lst n+p wc, by te property of promote stated above, results n opcell gettng a ready parent. P ten calls promote on lst (n + P)/, ten on lst (n + P)/, and so on, so tat opcell gets a grandparent, parent to grandparent etc. Ultmately, after log n suc calls, opcell as an ancestor n lst, and te state feld of ts ancestor corresponds to te state tat results after all operatons n pror trees are appled. P ten calls percolatestate, wc flls te state feld of opcell wt te state tat results after all operatons to te left of opcell are appled. P apples ts operaton op to ts state, and te resultng response s te mplementaton s response to op... How promote works We argue tat promote(lst) satsfes Lemma on te premse tat te followng two lemmas Lemmas and are true. Lemma After a cell d n lst lst or n lst lst + becomes a ready orpan, te lst lst can grow by at most two cells before d gets a ready parent. apply(op : nvoc) returns result. opcell := announce(op). lst := n + P. for := to log n. promote (lst). lst := lst/ 6. percolatestate(opcell, n + P). return δresp (opcell State, op) end apply promote(lst : nteger). d := append( lst/ ). f (d ) and ( lst/ > ) ten promote( lst/ ). append( lst/ ) end promote append(lst : nteger) returns cell. ead := Head[lst]. newcell := LL(ead Next). f newcell =. lc := readyorpan( lst). rc := readyorpan( lst + ) 6. f (lc ) or (rc ). c := combne(lc, rc) 8. SC (ead Next, c) 9. newcell := ead Next 0. f newcell = return. f newcell LC. newcell LC Parent := newcell. updatehead( lst, newcell LC). f newcell RC. newcell RC Parent := newcell 6. updatehead( lst +, newcell RC). newcell Ready := true 8. f lst = 9. newcell State := δ state (ead State, ead Op) 0. updatehead(lst, newcell). return newcell end append Fgure : Constructon for closed obects (contnued on te next fgure) Lemma (Property of append) If, before append(lst) s called, tere s a ready orpan d n lst lst or n lst lst +, ten executng te procedure eter ()causes d to get a ready parent or ()ensures tat some ready cell s appended to lst lst, and returns tat cell. Before promote(lst) s called, let c be a ready orpan n lst lst. We now sketc a proof of Lemma by argung tat,

7 readyorpan(lst : nteger) returns cell. ead := Head[lst]. next := ead Next. f (next ) and (next Ready). return next. else return end readyorpan updatehead(lst : nteger, c : cell). ead := LL(Head[lst]). f ead Next = c. SC(Head[lst], c) end updatehead announce(op : nvoc) returns cell. allocate a new cell c and ntalze t as follows: c Parent :=, c Next :=, c State := c LC :=, c RC :=, c Op := op, c Lop :=, c Ready := true. ead := Head[n + P]. ead Next := c. return c end announce combne(lc, rc : cell) returns cell. allocate a new cell c and ntalze t as follows: c Parent :=, c Next :=, c State := c LC := lc, c RC := rc, c Ready := false f lc c Lop := lc Op else c Lop := f rc c Op := combne-operatons(c Lop, rc Op) else c Op := c Lop. return c end combne percolatestate(c : cell, lst : nteger). f lst = return. p := c Parent. percolatestate(p, lst/ ). f lst = lst/. c State := p State 6. else c State := δ state (p State, p Lop) end percolatestate Fgure : Constructon for closed obects (contnued from prevous fgure) after completng te procedure, c as a ready parent. Snce promote s a recursve procedure, te argument s nductve. After executng Lne of promote, by Lemma, eter c gets a ready parent or some ready cell s appended to lst lst/ and returned, wc (n te algortm) s stored n d. In te former case, Lemma s mmedate. In te latter case, on Lne, promote( lst/ ) s recursvely called. By nducton ypotess, after ts recursve call, d as a ready parent. Terefore, by Part of Invarant, Head[ lst/ ] ponts to d or beyond d. On Lne of promote, append( lst/ ) s agan executed. After ts, by Lemma, eter c gets a ready parent or some ready cell e s appended to lst lst/ and returned. In te former case, Lemma s mmedate. In te latter case, we know tat e s after d n lst lst/. Tus, lst lst/ as grown by at least two cells (d and e are te two cells) snce c as become a ready orpan. Terefore, by Lemma, c as a ready parent. Hence Lemma... How append works A leaf lst,.e., lst n + P (0 P n ), grows wen process P executes announce(op) and treads ts operaton cell to te lst. An nteror lst lst ( lst n ), on te oter and, grows wen a process P executes append(lst). Rougly speakng, ts procedure fnds te end of lst lst, and appends tere a cell tat becomes parent to ready orpans n lsts lst and lst +. We now provde a detaled, yet nformal, descrpton of ow process P executes append(lst). P reads Head[lst] and obtans a ponter to te last parented cell n lst lst (stored n ead on lne ), and ten cecks f tere s an orpan next to ead (lnes and ). If tere s an orpan, t proceeds to elp t (lne onwards). Oterwse P looks at lsts lst and lst + to ceck f tey ave ready orpans (lnes and ). If so, P combnes te nformaton n te ready orpans and stores t n a new cell c (lne ) and attempts to append c at te end of lst lst (lne 8). Its attempt may fal f some oter process as already appended a cell next to ead. Regardless of weter t succeeded n appendng c or someone else succeeded n appendng some oter cell, P obtans a ponter to te cell next to ead (lne 9). If no cell exsts tere, t means tat tere was notng to append to ead, so P returns from te procedure wt (lne 0). Oterwse newcell s a cell tat as ust been appended next to ead, and P proceeds to notfy newcell s cldren of te fact tat tey now ave a parent. It sets te parent feld of newcell s left cld to newcell (lne ) and, snce newcell s left cld s now parented, updates Head[ lst] to pont to newcell LC (lne ). P notfes newcell s rgt cld smlarly (lnes -6). Once te cldren of newcell ave been notfed, newcell s permtted to get a parent. So P wrtes true n te Ready feld (lne ). If newcell s n lst, t s te root of a fully formed tree. Te state tat corresponds to applyng operatons of te prevous tree to te state n te root of te prevous tree s wrtten to newcell s state feld. Tus, newcell s state feld corresponds to applyng operatons n all prevous trees. Also, f newcell s n lst, t s te root; snce tere s no need for t to get a parent, te Head[] varable s updated to pont to newcell. P ten returns newcell, te cell appended to lst lst. Te proofs of Lemmas and follow from te append procedure. Tey are, owever, long and beyond te scope of ts extended abstract.

8 .8 Te man teorem We make te followng observatons:. A call to readyorpan, updatehead, announce, or combne results n O() accesses to sared obects and O() local steps.. A call to append(lst) results n O() sared-memory steps and O() local steps.. Wen te recurson n te promote procedure s elmnated, a call to promote results n at most log n calls to append, tus gvng rse to O(log n) sared-memory steps and O(log n) local steps.. A call to percolatestate(c, lst) results n O(log n) sared-memory steps and O(log n) local steps.. apply makes one call to announce, log n calls to promote, and one call to percolatestate. Terefore, a call to apply results n O(log n) sared-memory steps and O(log n) local steps. Tus, we ave: Teorem Te constructon presented n Fgure s lnearzable and wat-free. Te sared-access tme complexty and te local tme complexty of te constructon are bot O(log n). Contenton-senstve tme complexty We now descrbe an enancement to te constructon tat elps aceve a tme complexty of O(mn(n c, log n)) for eac operaton op, were n c s te number of processes wose operatons are concurrent wt op. Te dea, used below, of dong breadt-frst searc to attan contentonsenstve tme complexty s due to Afek, Dauber, and Toutou []. Te followng enancements are made to te earler constructon: (). We mantan one addtonal fxed bnary tree T tat as a total of log n nodes. We number tese nodes breadt frst, startng wt for te root of T. Eac node s value s eter a process d P, or. In te former case, te node as been captured by P. In te latter, t s avalable for capture. To capture a node n T, a process P performs a breadt-frst searc of te nodes of T, startng at te root, tryng to cange te value of an avalable node from to P, usng LL and SC operatons. (). In addton to te possble node postons as specfed by a bnary tree of egt log n (see Fgure (a)), we ave log n new node postons: + /, for =,,,log n. A node at poston + / s te mddle cld of te node at poston. (). In te new constructon, eac cell n lst lst, lst log n, as tree cldren: a left cld and a rgt cld as n te orgnal constructon, and a mddle cld, wc s eter or a cell n lst lst + /. Te mddle cld, f present, s a leaf. (). In te orgnal constructon, wen a process P nvokes a new operaton op, t stores op n a cell c, nstalls c (as a leaf) n te lst n+p (wc belongs exclusvely to P), and works towards makng c a part of a fully formed tree (.e., untl c as log n ancestors). In te new constructon, wen P nvokes a new operaton, t performs a breadt-frst searc of T, lookng for an avalable node n T to capture. Suppose P succeeds n capturng a node x n T numbered m. It stores op n a cell c, and nstalls c (as a leaf) n te lst m + /. P ten works towards gettng c a parent n lst m, a grandparent n lst m/ and so on, untl c as an ancestor n lst. Ten, P computes te response to ts operaton, and releases x by settng ts value to. Breadtfrst searc takes O(m) tme and te rest of te work takes O(log m). As n [], m s at most n c (n c s te contenton). Furter, snce T as only log n nodes, m log n. Tus, m mn(n c,log n). Hence we ave te desred bound. If P does not succeed n capturng a node n T, t follows from [] tat n c s more tan te number of nodes n T; tat s, n c > log n. In ts case, P performs ts operaton as n te orgnal constructon, by nstallng an opcell n lst n+p and workng towards te root from tere. In ts case, te total tme spent s O(log n), but ten we already argued tat n c > log n. So we ave te desred O(mn(n c,log n)) bound. (). For te strategy n () to work, we enance te append procedure so tat, wen attemptng to append a new cell c to te lst lst, lst log n, n addton to parentng any ready orpans n lsts lst and lst +, c wll also adopt as ts mddle cld any ready orpan n lst lst + /. (6). Up to tree operatons, as recorded n te Op felds of c s cldren, are combned and recorded n c s Op feld. In addton, c as a Mop feld tat records te operaton of c s mddle cld. Te procedure percolatestate s also approprately modfed. Memory management As presented, te data structures grow wtout bound. We now explan ow a fnte pool of cells suffces. Wen all te cldren of a cell c ave ter State felds set (lnes,6 of percolatestate), ten c s no longer needed for te operatons rooted at c to complete: suc an operaton OP can execute percolatestate recursvely, untl t reaces a cld d of c. Usng d State, te correct response to OP can be computed. Furter, f suc a cell c n lst lst s at least two cells bend Head[lst], any attempt to append a cell to lst tat accesses c can be aborted. Ts s because at least two new cells beyond c ave already been appended to lst. We add approprate bts to eac cell c to ndcate weter ()te State felds of c s cldren are set, () c s at least two cells bend Head[lst]. If so, c s ready to be reclamed, because all operatons can complete wtout c. We now descrbe te canges tat need to be made to our constructon, n order to reclam cells. Te owner of a cell c mantans locally a set of ponter values assocated wt te current ncarnaton of c: parent, LC, RC, prevous (were prevous Next = c). Tese are used to access all ponters tat pont to c some tme durng te current ncarnaton of c. Tere are two reserved values for te felds of c: # denotes tat c s currently nvald; %, wc s a reserved value for ponter felds p of c, denotes tat te cell ponted to by te prevous value n p s nvald. To kll an ncarnaton of c, c s owner Q wrtes # to every feld of c, and ten, usng ts local copy of ponters (parent, LC, RC, prevous), LL s all ponters p tat at some tme pont to te current ncarnaton of c. If p s stll pontng to c, Q executes SC(p,%) to sgnal tat c s nvald. Q

9 s now free to reuse c. If a process P encounters values #,% n executng any procedure, a recovery routne s executed, to allow P to contnue ts operaton. If P accesses cell c va ponter p, t must ensure tat c as not canged ts ncarnaton between te tme P reads p, and te tme P accesses c. To aceve ts, P executes LL(p) wen t frst reads p. P also follows any read of a feld of c by a V aldate operaton, VL(p). By examnng ow c s owner klls an ncarnaton of c, t can be seen tat f VL(p) succeeds, ten te value P read s of te same ncarnaton as tat ponted to by p. To wrte to a feld w of c, P frst executes LL(w), ten VL(p), and, f VL(p) succeeds, executes SC on w to wrte to w. An mportant feature ere s tat, f c s of a new ncarnaton wen P executes SC on w, ts SC wll fal. Agan, recovery procedures are executed wenever a new ncarnaton of a cell s encountered. By dove-talng te executon of te memory management procedure wt our constructon, eac process needs to mantan only a pool of O(nlog n) cells to ensure te constant avalablty of a free cell. (Furter detals are provded n te full verson of te paper.) References [] Afek, Y., Dauber, D., and Toutou, D. Wat-free made fast. In Proceedngs of te t Annual ACM Symposum on Teory of Computng (99), pp. 8. [] Afek, Y., Merrtt, M., Taubenfeld, G., and Toutou, D. Dsentanglng mult-obect operatons. In Proceedngs of te 6t Annual Symposum on Prncples of Dstrbuted Computng (August 99), pp. 0. [] Afek, Y., Wesberger, E., and Wesman, H. A completeness teorem for a class of syncronzaton obects. In Proceedngs of te t Annual Symposum on Prncples of Dstrbuted Computng (August 99), pp [] Anderson, J., and Mor, M. Unversal constructons for large obects. In Proceedngs of te 9t Internatonal Worksop on Dstrbuted Algortms (99), pp [] Anderson, J., and Mor, M. Unversal constructons for mult-obect operatons. In Proceedngs of te t Annual ACM Symposum on Prncples of Dstrbuted Computng (August 99), pp [6] Attya, H., and Dagan, E. Unversal operatons: unary versus bnary. In Proceedngs of te t Annual Symposum on Prncples of Dstrbuted Computng (May 996), pp.. [] Barnes, G. A metod for mplementng lock-free sared data structures. In Proceedngs of te t Annual ACM Symposum on Parallel Algortms and Arctectures (99), pp [8] Herly, M. Impossblty and unversalty results for wat-free syncronzaton. In Proceedngs of te t ACM Symposum on Prncples of Dstrbuted Computng (988). [9] Herly, M. Wat-free syncronzaton. ACM TOPLAS, (99), 9. [0] Herly, M. A metodology for mplementng gly concurrent data structures. ACM Transactons on Programmng Languages and Systems, (99), 0. [] Israel, A., and Rappoport, L. Dsont-Access- Parallel mplementatons of strong sared-memory prmtves. In Proceedngs of te t Annual ACM Symposum on Prncples of Dstrbuted Computng (August 99), pp. 60. [] Jayant, P. A lower bound on te local tme complexty of unversal constructons. In Proceedngs of te t Annual Symposum on Prncples of Dstrbuted Computng (June 998). [] Jayant, P. A tme complexty lower bound for randomzed mplementatons of some sared obects. In Proceedngs of te t Annual Symposum on Prncples of Dstrbuted Computng (June 998). [] Jayant, P., and Toueg, S. Some results on te mpossblty, unversalty, and decdablty of consensus. In Proceedngs of te 6t Worksop on Dstrbuted Algortms, Hafa, Israel (November 99). Appeared n Lecture Notes n Computer Scence, Sprnger-Verlag, No: 6. [] Klenberg, J., and Mullanatan, S. Resource bounds and combnatons of consensus obects. In Proceedngs of te t Annual Symposum on Prncples of Dstrbuted Computng (August 99). [6] Knut, D. E. Te Art of Computer Programmng, second ed., vol.. Addson-Wesley. [] Kruskal, C., Rudolf, L., and Snr, M. Effcent syncronzaton on multprocessors wt sared memory. In Proceedngs of te t Annual Symposum on Prncples of Dstrbuted Computng (August 986), pp [8] Mor, M. Practcal mplementatons of non-blockng syncronzaton prmtves. In Proceedngs of te 6t Annual ACM Symposum on Prncples of Dstrbuted Computng (August 99), pp [9] Mor, M. Transparent support for wat-free transactons. In Proceedngs of te t Internatonal Worksop on Dstrbuted Algortms (September 99), pp [0] Plotkn, S. Stcky bts and unversalty of consensus. In Proceedngs of te 8t ACM Symposum on Prncples of Dstrbuted Computng (August 989), pp. 9. [] Savt, N., and Toutou, D. Software transactonal memory. In Proceedngs of te t Annual ACM Symposum on Prncples of Dstrbuted Computng (August 99), pp. 0. [] Turek, J., Sasa, D., and Prakas, S. Lockng wtout blockng: Makng lock-based concurrent data structure algortms non-blockng. In Proceedngs of te t Symposum on Prncples of Database Systems (99), pp..

10 (a) (b) (c) 6 6 (d) 6 a b c d e f 6 g Tree Tree Tree Tree Tree (e) (g) C C (f) () () () C Process 0 s attempt to nstall C nto global structure fals C (k) (m) Lst (l) Lst Lst a f b c g d e Lst Lst Lst 6 Lst Fgure : (a)a fully formed tree for n=, (b)numberng a fully formed tree tat s not complete, (c)a non-fully formed tree, (d)a typcal snapsot of operaton cells, (e)process 0 creates an operaton cell for, (f)process 0 creates a cell wose left and rgt cldren are and, (g)process 0 creates a cell at poston. as now taken effect. ()Process creates a parent for, ()Process 0 creates an operaton cell for, ()Snce process 0 cannot create a parent for, t gets a parent for C, (k)process 0 gets a parent for, (l)process 0 gets a grandparent for. Operaton as now taken effect, (m)te lsts for te sequence of trees n (d).

Priority queues and heaps Professors Clark F. Olson and Carol Zander

Priority queues and heaps Professors Clark F. Olson and Carol Zander Prorty queues and eaps Professors Clark F. Olson and Carol Zander Prorty queues A common abstract data type (ADT) n computer scence s te prorty queue. As you mgt expect from te name, eac tem n te prorty

More information

The AVL Balance Condition. CSE 326: Data Structures. AVL Trees. The AVL Tree Data Structure. Is this an AVL Tree? Height of an AVL Tree

The AVL Balance Condition. CSE 326: Data Structures. AVL Trees. The AVL Tree Data Structure. Is this an AVL Tree? Height of an AVL Tree CSE : Data Structures AL Trees Neva Cernavsy Summer Te AL Balance Condton AL balance property: Left and rgt subtrees of every node ave egts dfferng by at most Ensures small dept ll prove ts by sowng tat

More information

Problem Set 3 Solutions

Problem Set 3 Solutions Introducton to Algorthms October 4, 2002 Massachusetts Insttute of Technology 6046J/18410J Professors Erk Demane and Shaf Goldwasser Handout 14 Problem Set 3 Solutons (Exercses were not to be turned n,

More information

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz

Compiler Design. Spring Register Allocation. Sample Exercises and Solutions. Prof. Pedro C. Diniz Compler Desgn Sprng 2014 Regster Allocaton Sample Exercses and Solutons Prof. Pedro C. Dnz USC / Informaton Scences Insttute 4676 Admralty Way, Sute 1001 Marna del Rey, Calforna 90292 pedro@s.edu Regster

More information

Module Management Tool in Software Development Organizations

Module Management Tool in Software Development Organizations Journal of Computer Scence (5): 8-, 7 ISSN 59-66 7 Scence Publcatons Management Tool n Software Development Organzatons Ahmad A. Al-Rababah and Mohammad A. Al-Rababah Faculty of IT, Al-Ahlyyah Amman Unversty,

More information

For instance, ; the five basic number-sets are increasingly more n A B & B A A = B (1)

For instance, ; the five basic number-sets are increasingly more n A B & B A A = B (1) Secton 1.2 Subsets and the Boolean operatons on sets If every element of the set A s an element of the set B, we say that A s a subset of B, or that A s contaned n B, or that B contans A, and we wrte A

More information

Complex Numbers. Now we also saw that if a and b were both positive then ab = a b. For a second let s forget that restriction and do the following.

Complex Numbers. Now we also saw that if a and b were both positive then ab = a b. For a second let s forget that restriction and do the following. Complex Numbers The last topc n ths secton s not really related to most of what we ve done n ths chapter, although t s somewhat related to the radcals secton as we wll see. We also won t need the materal

More information

Machine Learning. K-means Algorithm

Machine Learning. K-means Algorithm Macne Learnng CS 6375 --- Sprng 2015 Gaussan Mture Model GMM pectaton Mamzaton M Acknowledgement: some sldes adopted from Crstoper Bsop Vncent Ng. 1 K-means Algortm Specal case of M Goal: represent a data

More information

An Optimal Algorithm for Prufer Codes *

An Optimal Algorithm for Prufer Codes * J. Software Engneerng & Applcatons, 2009, 2: 111-115 do:10.4236/jsea.2009.22016 Publshed Onlne July 2009 (www.scrp.org/journal/jsea) An Optmal Algorthm for Prufer Codes * Xaodong Wang 1, 2, Le Wang 3,

More information

Parallelism for Nested Loops with Non-uniform and Flow Dependences

Parallelism for Nested Loops with Non-uniform and Flow Dependences Parallelsm for Nested Loops wth Non-unform and Flow Dependences Sam-Jn Jeong Dept. of Informaton & Communcaton Engneerng, Cheonan Unversty, 5, Anseo-dong, Cheonan, Chungnam, 330-80, Korea. seong@cheonan.ac.kr

More information

CE 221 Data Structures and Algorithms

CE 221 Data Structures and Algorithms CE 1 ata Structures and Algorthms Chapter 4: Trees BST Text: Read Wess, 4.3 Izmr Unversty of Economcs 1 The Search Tree AT Bnary Search Trees An mportant applcaton of bnary trees s n searchng. Let us assume

More information

CSE 326: Data Structures Quicksort Comparison Sorting Bound

CSE 326: Data Structures Quicksort Comparison Sorting Bound CSE 326: Data Structures Qucksort Comparson Sortng Bound Steve Setz Wnter 2009 Qucksort Qucksort uses a dvde and conquer strategy, but does not requre the O(N) extra space that MergeSort does. Here s the

More information

Load Balancing for Hex-Cell Interconnection Network

Load Balancing for Hex-Cell Interconnection Network Int. J. Communcatons, Network and System Scences,,, - Publshed Onlne Aprl n ScRes. http://www.scrp.org/journal/jcns http://dx.do.org/./jcns.. Load Balancng for Hex-Cell Interconnecton Network Saher Manaseer,

More information

Sorting Review. Sorting. Comparison Sorting. CSE 680 Prof. Roger Crawfis. Assumptions

Sorting Review. Sorting. Comparison Sorting. CSE 680 Prof. Roger Crawfis. Assumptions Sortng Revew Introducton to Algorthms Qucksort CSE 680 Prof. Roger Crawfs Inserton Sort T(n) = Θ(n 2 ) In-place Merge Sort T(n) = Θ(n lg(n)) Not n-place Selecton Sort (from homework) T(n) = Θ(n 2 ) In-place

More information

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009.

Assignment # 2. Farrukh Jabeen Algorithms 510 Assignment #2 Due Date: June 15, 2009. Farrukh Jabeen Algorthms 51 Assgnment #2 Due Date: June 15, 29. Assgnment # 2 Chapter 3 Dscrete Fourer Transforms Implement the FFT for the DFT. Descrbed n sectons 3.1 and 3.2. Delverables: 1. Concse descrpton

More information

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour

6.854 Advanced Algorithms Petar Maymounkov Problem Set 11 (November 23, 2005) With: Benjamin Rossman, Oren Weimann, and Pouya Kheradpour 6.854 Advanced Algorthms Petar Maymounkov Problem Set 11 (November 23, 2005) Wth: Benjamn Rossman, Oren Wemann, and Pouya Kheradpour Problem 1. We reduce vertex cover to MAX-SAT wth weghts, such that the

More information

Course Introduction. Algorithm 8/31/2017. COSC 320 Advanced Data Structures and Algorithms. COSC 320 Advanced Data Structures and Algorithms

Course Introduction. Algorithm 8/31/2017. COSC 320 Advanced Data Structures and Algorithms. COSC 320 Advanced Data Structures and Algorithms Course Introducton Course Topcs Exams, abs, Proects A quc loo at a few algorthms 1 Advanced Data Structures and Algorthms Descrpton: We are gong to dscuss algorthm complexty analyss, algorthm desgn technques

More information

CMPS 10 Introduction to Computer Science Lecture Notes

CMPS 10 Introduction to Computer Science Lecture Notes CPS 0 Introducton to Computer Scence Lecture Notes Chapter : Algorthm Desgn How should we present algorthms? Natural languages lke Englsh, Spansh, or French whch are rch n nterpretaton and meanng are not

More information

CSE 326: Data Structures Quicksort Comparison Sorting Bound

CSE 326: Data Structures Quicksort Comparison Sorting Bound CSE 326: Data Structures Qucksort Comparson Sortng Bound Bran Curless Sprng 2008 Announcements (5/14/08) Homework due at begnnng of class on Frday. Secton tomorrow: Graded homeworks returned More dscusson

More information

Programming in Fortran 90 : 2017/2018

Programming in Fortran 90 : 2017/2018 Programmng n Fortran 90 : 2017/2018 Programmng n Fortran 90 : 2017/2018 Exercse 1 : Evaluaton of functon dependng on nput Wrte a program who evaluate the functon f (x,y) for any two user specfed values

More information

Intro. Iterators. 1. Access

Intro. Iterators. 1. Access Intro Ths mornng I d lke to talk a lttle bt about s and s. We wll start out wth smlartes and dfferences, then we wll see how to draw them n envronment dagrams, and we wll fnsh wth some examples. Happy

More information

On Some Entertaining Applications of the Concept of Set in Computer Science Course

On Some Entertaining Applications of the Concept of Set in Computer Science Course On Some Entertanng Applcatons of the Concept of Set n Computer Scence Course Krasmr Yordzhev *, Hrstna Kostadnova ** * Assocate Professor Krasmr Yordzhev, Ph.D., Faculty of Mathematcs and Natural Scences,

More information

A Distributed First and Last Consistent Global Checkpoint Algorithm

A Distributed First and Last Consistent Global Checkpoint Algorithm A Dstrbuted Frst and Last Consstent Global Cecpont Algortm Yosfum Manabe NTT Basc Researc Laboratores 3-1 Mornosato-Waamya, Atsug-s, Kanagawa 43-01 Japan manabe@teory.brl.ntt.co.p Abstract Dstrbuted coordnated

More information

Investigations of Topology and Shape of Multi-material Optimum Design of Structures

Investigations of Topology and Shape of Multi-material Optimum Design of Structures Advanced Scence and Tecnology Letters Vol.141 (GST 2016), pp.241-245 ttp://dx.do.org/10.14257/astl.2016.141.52 Investgatons of Topology and Sape of Mult-materal Optmum Desgn of Structures Quoc Hoan Doan

More information

ON SOME ENTERTAINING APPLICATIONS OF THE CONCEPT OF SET IN COMPUTER SCIENCE COURSE

ON SOME ENTERTAINING APPLICATIONS OF THE CONCEPT OF SET IN COMPUTER SCIENCE COURSE Yordzhev K., Kostadnova H. Інформаційні технології в освіті ON SOME ENTERTAINING APPLICATIONS OF THE CONCEPT OF SET IN COMPUTER SCIENCE COURSE Yordzhev K., Kostadnova H. Some aspects of programmng educaton

More information

The Greedy Method. Outline and Reading. Change Money Problem. Greedy Algorithms. Applications of the Greedy Strategy. The Greedy Method Technique

The Greedy Method. Outline and Reading. Change Money Problem. Greedy Algorithms. Applications of the Greedy Strategy. The Greedy Method Technique //00 :0 AM Outlne and Readng The Greedy Method The Greedy Method Technque (secton.) Fractonal Knapsack Problem (secton..) Task Schedulng (secton..) Mnmum Spannng Trees (secton.) Change Money Problem Greedy

More information

Data Representation in Digital Design, a Single Conversion Equation and a Formal Languages Approach

Data Representation in Digital Design, a Single Conversion Equation and a Formal Languages Approach Data Representaton n Dgtal Desgn, a Sngle Converson Equaton and a Formal Languages Approach Hassan Farhat Unversty of Nebraska at Omaha Abstract- In the study of data representaton n dgtal desgn and computer

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms Desgn and Analyss of Algorthms Heaps and Heapsort Reference: CLRS Chapter 6 Topcs: Heaps Heapsort Prorty queue Huo Hongwe Recap and overvew The story so far... Inserton sort runnng tme of Θ(n 2 ); sorts

More information

Hermite Splines in Lie Groups as Products of Geodesics

Hermite Splines in Lie Groups as Products of Geodesics Hermte Splnes n Le Groups as Products of Geodescs Ethan Eade Updated May 28, 2017 1 Introducton 1.1 Goal Ths document defnes a curve n the Le group G parametrzed by tme and by structural parameters n the

More information

Array transposition in CUDA shared memory

Array transposition in CUDA shared memory Array transposton n CUDA shared memory Mke Gles February 19, 2014 Abstract Ths short note s nspred by some code wrtten by Jeremy Appleyard for the transposton of data through shared memory. I had some

More information

Prof. Feng Liu. Spring /24/2017

Prof. Feng Liu. Spring /24/2017 Prof. Feng Lu Sprng 2017 ttp://www.cs.pd.edu/~flu/courses/cs510/ 05/24/2017 Last me Compostng and Mattng 2 oday Vdeo Stablzaton Vdeo stablzaton ppelne 3 Orson Welles, ouc of Evl, 1958 4 Images courtesy

More information

An Analytical Tool to Assess Readiness of Existing Networks for Deploying IP Telephony

An Analytical Tool to Assess Readiness of Existing Networks for Deploying IP Telephony An Analytcal Tool to Assess Readness of Exstng Networks for Deployng IP Telepony K. Sala M. Almasar Department of Informaton and Computer Scence Kng Fad Unversty of Petroleum and Mnerals Daran 31261, Saud

More information

The Codesign Challenge

The Codesign Challenge ECE 4530 Codesgn Challenge Fall 2007 Hardware/Software Codesgn The Codesgn Challenge Objectves In the codesgn challenge, your task s to accelerate a gven software reference mplementaton as fast as possble.

More information

A Binarization Algorithm specialized on Document Images and Photos

A Binarization Algorithm specialized on Document Images and Photos A Bnarzaton Algorthm specalzed on Document mages and Photos Ergna Kavalleratou Dept. of nformaton and Communcaton Systems Engneerng Unversty of the Aegean kavalleratou@aegean.gr Abstract n ths paper, a

More information

Bounding Tree Cover Number and Positive Semidefinite Zero Forcing Number

Bounding Tree Cover Number and Positive Semidefinite Zero Forcing Number Bounding Tree Cover Number and Positive Semidefinite Zero Forcing Number Sofia Burille Mentor: Micael Natanson September 15, 2014 Abstract Given a grap, G, wit a set of vertices, v, and edges, various

More information

CSCI 104 Sorting Algorithms. Mark Redekopp David Kempe

CSCI 104 Sorting Algorithms. Mark Redekopp David Kempe CSCI 104 Sortng Algorthms Mark Redekopp Davd Kempe Algorthm Effcency SORTING 2 Sortng If we have an unordered lst, sequental search becomes our only choce If we wll perform a lot of searches t may be benefcal

More information

Sequential search. Building Java Programs Chapter 13. Sequential search. Sequential search

Sequential search. Building Java Programs Chapter 13. Sequential search. Sequential search Sequental search Buldng Java Programs Chapter 13 Searchng and Sortng sequental search: Locates a target value n an array/lst by examnng each element from start to fnsh. How many elements wll t need to

More information

Assembler. Building a Modern Computer From First Principles.

Assembler. Building a Modern Computer From First Principles. Assembler Buldng a Modern Computer From Frst Prncples www.nand2tetrs.org Elements of Computng Systems, Nsan & Schocken, MIT Press, www.nand2tetrs.org, Chapter 6: Assembler slde Where we are at: Human Thought

More information

Today s Outline. Sorting: The Big Picture. Why Sort? Selection Sort: Idea. Insertion Sort: Idea. Sorting Chapter 7 in Weiss.

Today s Outline. Sorting: The Big Picture. Why Sort? Selection Sort: Idea. Insertion Sort: Idea. Sorting Chapter 7 in Weiss. Today s Outlne Sortng Chapter 7 n Wess CSE 26 Data Structures Ruth Anderson Announcements Wrtten Homework #6 due Frday 2/26 at the begnnng of lecture Proect Code due Mon March 1 by 11pm Today s Topcs:

More information

A mathematical programming approach to the analysis, design and scheduling of offshore oilfields

A mathematical programming approach to the analysis, design and scheduling of offshore oilfields 17 th European Symposum on Computer Aded Process Engneerng ESCAPE17 V. Plesu and P.S. Agach (Edtors) 2007 Elsever B.V. All rghts reserved. 1 A mathematcal programmng approach to the analyss, desgn and

More information

AADL : about scheduling analysis

AADL : about scheduling analysis AADL : about schedulng analyss Schedulng analyss, what s t? Embedded real-tme crtcal systems have temporal constrants to meet (e.g. deadlne). Many systems are bult wth operatng systems provdng multtaskng

More information

Machine Learning: Algorithms and Applications

Machine Learning: Algorithms and Applications 14/05/1 Machne Learnng: Algorthms and Applcatons Florano Zn Free Unversty of Bozen-Bolzano Faculty of Computer Scence Academc Year 011-01 Lecture 10: 14 May 01 Unsupervsed Learnng cont Sldes courtesy of

More information

Mode-seeking by Medoidshifts

Mode-seeking by Medoidshifts Mode-seekng by Medodsfts Yaser Ajmal Sek Robotcs Insttute Carnege Mellon Unversty yaser@cs.cmu.edu Erum Arf Kan Department of Computer Scence Unversty of Central Florda ekan@cs.ucf.edu Takeo Kanade Robotcs

More information

Insertion Sort. Divide and Conquer Sorting. Divide and Conquer. Mergesort. Mergesort Example. Auxiliary Array

Insertion Sort. Divide and Conquer Sorting. Divide and Conquer. Mergesort. Mergesort Example. Auxiliary Array Inserton Sort Dvde and Conquer Sortng CSE 6 Data Structures Lecture 18 What f frst k elements of array are already sorted? 4, 7, 1, 5, 1, 16 We can shft the tal of the sorted elements lst down and then

More information

Math Homotopy Theory Additional notes

Math Homotopy Theory Additional notes Math 527 - Homotopy Theory Addtonal notes Martn Frankland February 4, 2013 The category Top s not Cartesan closed. problem. In these notes, we explan how to remedy that 1 Compactly generated spaces Ths

More information

CHAPTER 2 DECOMPOSITION OF GRAPHS

CHAPTER 2 DECOMPOSITION OF GRAPHS CHAPTER DECOMPOSITION OF GRAPHS. INTRODUCTION A graph H s called a Supersubdvson of a graph G f H s obtaned from G by replacng every edge uv of G by a bpartte graph,m (m may vary for each edge by dentfyng

More information

Sum of Linear and Fractional Multiobjective Programming Problem under Fuzzy Rules Constraints

Sum of Linear and Fractional Multiobjective Programming Problem under Fuzzy Rules Constraints Australan Journal of Basc and Appled Scences, 2(4): 1204-1208, 2008 ISSN 1991-8178 Sum of Lnear and Fractonal Multobjectve Programmng Problem under Fuzzy Rules Constrants 1 2 Sanjay Jan and Kalash Lachhwan

More information

Parallel matrix-vector multiplication

Parallel matrix-vector multiplication Appendx A Parallel matrx-vector multplcaton The reduced transton matrx of the three-dmensonal cage model for gel electrophoress, descrbed n secton 3.2, becomes excessvely large for polymer lengths more

More information

Esc101 Lecture 1 st April, 2008 Generating Permutation

Esc101 Lecture 1 st April, 2008 Generating Permutation Esc101 Lecture 1 Aprl, 2008 Generatng Permutaton In ths class we wll look at a problem to wrte a program that takes as nput 1,2,...,N and prnts out all possble permutatons of the numbers 1,2,...,N. For

More information

Mathematics 256 a course in differential equations for engineering students

Mathematics 256 a course in differential equations for engineering students Mathematcs 56 a course n dfferental equatons for engneerng students Chapter 5. More effcent methods of numercal soluton Euler s method s qute neffcent. Because the error s essentally proportonal to the

More information

CS1100 Introduction to Programming

CS1100 Introduction to Programming Factoral (n) Recursve Program fact(n) = n*fact(n-) CS00 Introducton to Programmng Recurson and Sortng Madhu Mutyam Department of Computer Scence and Engneerng Indan Insttute of Technology Madras nt fact

More information

CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar

CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vidyanagar CHARUTAR VIDYA MANDAL S SEMCOM Vallabh Vdyanagar Faculty Name: Am D. Trved Class: SYBCA Subject: US03CBCA03 (Advanced Data & Fle Structure) *UNIT 1 (ARRAYS AND TREES) **INTRODUCTION TO ARRAYS If we want

More information

Sorting. Sorting. Why Sort? Consistent Ordering

Sorting. Sorting. Why Sort? Consistent Ordering Sortng CSE 6 Data Structures Unt 15 Readng: Sectons.1-. Bubble and Insert sort,.5 Heap sort, Secton..6 Radx sort, Secton.6 Mergesort, Secton. Qucksort, Secton.8 Lower bound Sortng Input an array A of data

More information

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes

R s s f. m y s. SPH3UW Unit 7.3 Spherical Concave Mirrors Page 1 of 12. Notes SPH3UW Unt 7.3 Sphercal Concave Mrrors Page 1 of 1 Notes Physcs Tool box Concave Mrror If the reflectng surface takes place on the nner surface of the sphercal shape so that the centre of the mrror bulges

More information

Section 2.3: Calculating Limits using the Limit Laws

Section 2.3: Calculating Limits using the Limit Laws Section 2.3: Calculating Limits using te Limit Laws In previous sections, we used graps and numerics to approimate te value of a it if it eists. Te problem wit tis owever is tat it does not always give

More information

2x x l. Module 3: Element Properties Lecture 4: Lagrange and Serendipity Elements

2x x l. Module 3: Element Properties Lecture 4: Lagrange and Serendipity Elements Module 3: Element Propertes Lecture : Lagrange and Serendpty Elements 5 In last lecture note, the nterpolaton functons are derved on the bass of assumed polynomal from Pascal s trangle for the fled varable.

More information

Virtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory

Virtual Memory. Background. No. 10. Virtual Memory: concept. Logical Memory Space (review) Demand Paging(1) Virtual Memory Background EECS. Operatng System Fundamentals No. Vrtual Memory Prof. Hu Jang Department of Electrcal Engneerng and Computer Scence, York Unversty Memory-management methods normally requres the entre process

More information

Support Vector Machines

Support Vector Machines /9/207 MIST.6060 Busness Intellgence and Data Mnng What are Support Vector Machnes? Support Vector Machnes Support Vector Machnes (SVMs) are supervsed learnng technques that analyze data and recognze patterns.

More information

CS221: Algorithms and Data Structures. Priority Queues and Heaps. Alan J. Hu (Borrowing slides from Steve Wolfman)

CS221: Algorithms and Data Structures. Priority Queues and Heaps. Alan J. Hu (Borrowing slides from Steve Wolfman) CS: Algorthms and Data Structures Prorty Queues and Heaps Alan J. Hu (Borrowng sldes from Steve Wolfman) Learnng Goals After ths unt, you should be able to: Provde examples of approprate applcatons for

More information

Compiling Process Networks to Interaction Nets

Compiling Process Networks to Interaction Nets Complng Process Networks to Interacton Nets Ian Macke LIX, CNRS UMR 7161, École Polytechnque, 91128 Palaseau Cede, France Kahn process networks are a model of computaton based on a collecton of sequental,

More information

Steps for Computing the Dissimilarity, Entropy, Herfindahl-Hirschman and. Accessibility (Gravity with Competition) Indices

Steps for Computing the Dissimilarity, Entropy, Herfindahl-Hirschman and. Accessibility (Gravity with Competition) Indices Steps for Computng the Dssmlarty, Entropy, Herfndahl-Hrschman and Accessblty (Gravty wth Competton) Indces I. Dssmlarty Index Measurement: The followng formula can be used to measure the evenness between

More information

Optimization Methods: Integer Programming Integer Linear Programming 1. Module 7 Lecture Notes 1. Integer Linear Programming

Optimization Methods: Integer Programming Integer Linear Programming 1. Module 7 Lecture Notes 1. Integer Linear Programming Optzaton Methods: Integer Prograng Integer Lnear Prograng Module Lecture Notes Integer Lnear Prograng Introducton In all the prevous lectures n lnear prograng dscussed so far, the desgn varables consdered

More information

Harvard University CS 101 Fall 2005, Shimon Schocken. Assembler. Elements of Computing Systems 1 Assembler (Ch. 6)

Harvard University CS 101 Fall 2005, Shimon Schocken. Assembler. Elements of Computing Systems 1 Assembler (Ch. 6) Harvard Unversty CS 101 Fall 2005, Shmon Schocken Assembler Elements of Computng Systems 1 Assembler (Ch. 6) Why care about assemblers? Because Assemblers employ some nfty trcks Assemblers are the frst

More information

NAG Fortran Library Chapter Introduction. G10 Smoothing in Statistics

NAG Fortran Library Chapter Introduction. G10 Smoothing in Statistics Introducton G10 NAG Fortran Lbrary Chapter Introducton G10 Smoothng n Statstcs Contents 1 Scope of the Chapter... 2 2 Background to the Problems... 2 2.1 Smoothng Methods... 2 2.2 Smoothng Splnes and Regresson

More information

Transaction-Consistent Global Checkpoints in a Distributed Database System

Transaction-Consistent Global Checkpoints in a Distributed Database System Proceedngs of the World Congress on Engneerng 2008 Vol I Transacton-Consstent Global Checkponts n a Dstrbuted Database System Jang Wu, D. Manvannan and Bhavan Thurasngham Abstract Checkpontng and rollback

More information

Pass by Reference vs. Pass by Value

Pass by Reference vs. Pass by Value Pass by Reference vs. Pass by Value Most methods are passed arguments when they are called. An argument may be a constant or a varable. For example, n the expresson Math.sqrt(33) the constant 33 s passed

More information

ELEC 377 Operating Systems. Week 6 Class 3

ELEC 377 Operating Systems. Week 6 Class 3 ELEC 377 Operatng Systems Week 6 Class 3 Last Class Memory Management Memory Pagng Pagng Structure ELEC 377 Operatng Systems Today Pagng Szes Vrtual Memory Concept Demand Pagng ELEC 377 Operatng Systems

More information

Tsinghua University at TAC 2009: Summarizing Multi-documents by Information Distance

Tsinghua University at TAC 2009: Summarizing Multi-documents by Information Distance Tsnghua Unversty at TAC 2009: Summarzng Mult-documents by Informaton Dstance Chong Long, Mnle Huang, Xaoyan Zhu State Key Laboratory of Intellgent Technology and Systems, Tsnghua Natonal Laboratory for

More information

Brave New World Pseudocode Reference

Brave New World Pseudocode Reference Brave New World Pseudocode Reference Pseudocode s a way to descrbe how to accomplsh tasks usng basc steps lke those a computer mght perform. In ths week s lab, you'll see how a form of pseudocode can be

More information

Lecture 5: Multilayer Perceptrons

Lecture 5: Multilayer Perceptrons Lecture 5: Multlayer Perceptrons Roger Grosse 1 Introducton So far, we ve only talked about lnear models: lnear regresson and lnear bnary classfers. We noted that there are functons that can t be represented

More information

Concurrent models of computation for embedded software

Concurrent models of computation for embedded software Concurrent models of computaton for embedded software and hardware! Researcher overvew what t looks lke semantcs what t means and how t relates desgnng an actor language actor propertes and how to represent

More information

GSLM Operations Research II Fall 13/14

GSLM Operations Research II Fall 13/14 GSLM 58 Operatons Research II Fall /4 6. Separable Programmng Consder a general NLP mn f(x) s.t. g j (x) b j j =. m. Defnton 6.. The NLP s a separable program f ts objectve functon and all constrants are

More information

Analysis of Continuous Beams in General

Analysis of Continuous Beams in General Analyss of Contnuous Beams n General Contnuous beams consdered here are prsmatc, rgdly connected to each beam segment and supported at varous ponts along the beam. onts are selected at ponts of support,

More information

PYTHON IMPLEMENTATION OF VISUAL SECRET SHARING SCHEMES

PYTHON IMPLEMENTATION OF VISUAL SECRET SHARING SCHEMES PYTHON IMPLEMENTATION OF VISUAL SECRET SHARING SCHEMES Ruxandra Olmd Faculty of Mathematcs and Computer Scence, Unversty of Bucharest Emal: ruxandra.olmd@fm.unbuc.ro Abstract Vsual secret sharng schemes

More information

Sorting: The Big Picture. The steps of QuickSort. QuickSort Example. QuickSort Example. QuickSort Example. Recursive Quicksort

Sorting: The Big Picture. The steps of QuickSort. QuickSort Example. QuickSort Example. QuickSort Example. Recursive Quicksort Sortng: The Bg Pcture Gven n comparable elements n an array, sort them n an ncreasng (or decreasng) order. Smple algorthms: O(n ) Inserton sort Selecton sort Bubble sort Shell sort Fancer algorthms: O(n

More information

An Application of the Dulmage-Mendelsohn Decomposition to Sparse Null Space Bases of Full Row Rank Matrices

An Application of the Dulmage-Mendelsohn Decomposition to Sparse Null Space Bases of Full Row Rank Matrices Internatonal Mathematcal Forum, Vol 7, 2012, no 52, 2549-2554 An Applcaton of the Dulmage-Mendelsohn Decomposton to Sparse Null Space Bases of Full Row Rank Matrces Mostafa Khorramzadeh Department of Mathematcal

More information

F Geometric Mean Graphs

F Geometric Mean Graphs Avalable at http://pvamu.edu/aam Appl. Appl. Math. ISSN: 1932-9466 Vol. 10, Issue 2 (December 2015), pp. 937-952 Applcatons and Appled Mathematcs: An Internatonal Journal (AAM) F Geometrc Mean Graphs A.

More information

Greedy Technique - Definition

Greedy Technique - Definition Greedy Technque Greedy Technque - Defnton The greedy method s a general algorthm desgn paradgm, bult on the follong elements: confguratons: dfferent choces, collectons, or values to fnd objectve functon:

More information

Private Information Retrieval (PIR)

Private Information Retrieval (PIR) 2 Levente Buttyán Problem formulaton Alce wants to obtan nformaton from a database, but she does not want the database to learn whch nformaton she wanted e.g., Alce s an nvestor queryng a stock-market

More information

Chapter 6 Programmng the fnte element method Inow turn to the man subject of ths book: The mplementaton of the fnte element algorthm n computer programs. In order to make my dscusson as straghtforward

More information

such that is accepted of states in , where Finite Automata Lecture 2-1: Regular Languages be an FA. A string is the transition function,

such that is accepted of states in , where Finite Automata Lecture 2-1: Regular Languages be an FA. A string is the transition function, * Lecture - Regular Languages S Lecture - Fnte Automata where A fnte automaton s a -tuple s a fnte set called the states s a fnte set called the alphabet s the transton functon s the ntal state s the set

More information

CHAPTER 10: ALGORITHM DESIGN TECHNIQUES

CHAPTER 10: ALGORITHM DESIGN TECHNIQUES CHAPTER 10: ALGORITHM DESIGN TECHNIQUES So far, we have been concerned wth the effcent mplementaton of algorthms. We have seen that when an algorthm s gven, the actual data structures need not be specfed.

More information

Cluster Analysis of Electrical Behavior

Cluster Analysis of Electrical Behavior Journal of Computer and Communcatons, 205, 3, 88-93 Publshed Onlne May 205 n ScRes. http://www.scrp.org/ournal/cc http://dx.do.org/0.4236/cc.205.350 Cluster Analyss of Electrcal Behavor Ln Lu Ln Lu, School

More information

News. Recap: While Loop Example. Reading. Recap: Do Loop Example. Recap: For Loop Example

News. Recap: While Loop Example. Reading. Recap: Do Loop Example. Recap: For Loop Example Unversty of Brtsh Columba CPSC, Intro to Computaton Jan-Apr Tamara Munzner News Assgnment correctons to ASCIIArtste.java posted defntely read WebCT bboards Arrays Lecture, Tue Feb based on sldes by Kurt

More information

4.1 Tangent Lines. y 2 y 1 = y 2 y 1

4.1 Tangent Lines. y 2 y 1 = y 2 y 1 41 Tangent Lines Introduction Recall tat te slope of a line tells us ow fast te line rises or falls Given distinct points (x 1, y 1 ) and (x 2, y 2 ), te slope of te line troug tese two points is cange

More information

Explicit Formulas and Efficient Algorithm for Moment Computation of Coupled RC Trees with Lumped and Distributed Elements

Explicit Formulas and Efficient Algorithm for Moment Computation of Coupled RC Trees with Lumped and Distributed Elements Explct Formulas and Effcent Algorthm for Moment Computaton of Coupled RC Trees wth Lumped and Dstrbuted Elements Qngan Yu and Ernest S.Kuh Electroncs Research Lab. Unv. of Calforna at Berkeley Berkeley

More information

Solving two-person zero-sum game by Matlab

Solving two-person zero-sum game by Matlab Appled Mechancs and Materals Onlne: 2011-02-02 ISSN: 1662-7482, Vols. 50-51, pp 262-265 do:10.4028/www.scentfc.net/amm.50-51.262 2011 Trans Tech Publcatons, Swtzerland Solvng two-person zero-sum game by

More information

3D vector computer graphics

3D vector computer graphics 3D vector computer graphcs Paolo Varagnolo: freelance engneer Padova Aprl 2016 Prvate Practce ----------------------------------- 1. Introducton Vector 3D model representaton n computer graphcs requres

More information

USING GRAPHING SKILLS

USING GRAPHING SKILLS Name: BOLOGY: Date: _ Class: USNG GRAPHNG SKLLS NTRODUCTON: Recorded data can be plotted on a graph. A graph s a pctoral representaton of nformaton recorded n a data table. t s used to show a relatonshp

More information

A Facet Generation Procedure. for solving 0/1 integer programs

A Facet Generation Procedure. for solving 0/1 integer programs A Facet Generaton Procedure for solvng 0/ nteger programs by Gyana R. Parja IBM Corporaton, Poughkeepse, NY 260 Radu Gaddov Emery Worldwde Arlnes, Vandala, Oho 45377 and Wlbert E. Wlhelm Teas A&M Unversty,

More information

an assocated logc allows the proof of safety and lveness propertes. The Unty model nvolves on the one hand a programmng language and, on the other han

an assocated logc allows the proof of safety and lveness propertes. The Unty model nvolves on the one hand a programmng language and, on the other han UNITY as a Tool for Desgn and Valdaton of a Data Replcaton System Phlppe Quennec Gerard Padou CENA IRIT-ENSEEIHT y Nnth Internatonal Conference on Systems Engneerng Unversty of Nevada, Las Vegas { 14-16

More information

Cordial and 3-Equitable Labeling for Some Star Related Graphs

Cordial and 3-Equitable Labeling for Some Star Related Graphs Internatonal Mathematcal Forum, 4, 009, no. 31, 1543-1553 Cordal and 3-Equtable Labelng for Some Star Related Graphs S. K. Vadya Department of Mathematcs, Saurashtra Unversty Rajkot - 360005, Gujarat,

More information

K-means and Hierarchical Clustering

K-means and Hierarchical Clustering Note to other teachers and users of these sldes. Andrew would be delghted f you found ths source materal useful n gvng your own lectures. Feel free to use these sldes verbatm, or to modfy them to ft your

More information

Circuit Analysis I (ENGR 2405) Chapter 3 Method of Analysis Nodal(KCL) and Mesh(KVL)

Circuit Analysis I (ENGR 2405) Chapter 3 Method of Analysis Nodal(KCL) and Mesh(KVL) Crcut Analyss I (ENG 405) Chapter Method of Analyss Nodal(KCL) and Mesh(KVL) Nodal Analyss If nstead of focusng on the oltages of the crcut elements, one looks at the oltages at the nodes of the crcut,

More information

UNIT 2 : INEQUALITIES AND CONVEX SETS

UNIT 2 : INEQUALITIES AND CONVEX SETS UNT 2 : NEQUALTES AND CONVEX SETS ' Structure 2. ntroducton Objectves, nequaltes and ther Graphs Convex Sets and ther Geometry Noton of Convex Sets Extreme Ponts of Convex Set Hyper Planes and Half Spaces

More information

Rational Interpolants with Tension Parameters

Rational Interpolants with Tension Parameters Ratonal Interpolants wt Tenson Parameters Gulo Cascola and Luca Roman Abstract. In ts paper we present a NURBS verson of te ratonal nterpolatng splne wt tenson ntroduced n [2], and we extend our proposal

More information

Efficient Distributed File System (EDFS)

Efficient Distributed File System (EDFS) Effcent Dstrbuted Fle System (EDFS) (Sem-Centralzed) Debessay(Debsh) Fesehaye, Rahul Malk & Klara Naherstedt Unversty of Illnos-Urbana Champagn Contents Problem Statement, Related Work, EDFS Desgn Rate

More information

The stream cipher MICKEY-128 (version 1) Algorithm specification issue 1.0

The stream cipher MICKEY-128 (version 1) Algorithm specification issue 1.0 The stream cpher MICKEY-128 (verson 1 Algorthm specfcaton ssue 1. Steve Babbage Vodafone Group R&D, Newbury, UK steve.babbage@vodafone.com Matthew Dodd Independent consultant matthew@mdodd.net www.mdodd.net

More information

O n processors in CRCW PRAM

O n processors in CRCW PRAM PARALLEL COMPLEXITY OF SINGLE SOURCE SHORTEST PATH ALGORITHMS Mshra, P. K. Department o Appled Mathematcs Brla Insttute o Technology, Mesra Ranch-8355 (Inda) & Dept. o Electroncs & Electrcal Communcaton

More information

Assembler. Shimon Schocken. Spring Elements of Computing Systems 1 Assembler (Ch. 6) Compiler. abstract interface.

Assembler. Shimon Schocken. Spring Elements of Computing Systems 1 Assembler (Ch. 6) Compiler. abstract interface. IDC Herzlya Shmon Schocken Assembler Shmon Schocken Sprng 2005 Elements of Computng Systems 1 Assembler (Ch. 6) Where we are at: Human Thought Abstract desgn Chapters 9, 12 abstract nterface H.L. Language

More information