Some Terminologies. Some Terminologies. Trees. Example: UNIX Directory. Trees. Binary Trees, Binary Search Trees 1/9/2014

Size: px
Start display at page:

Download "Some Terminologies. Some Terminologies. Trees. Example: UNIX Directory. Trees. Binary Trees, Binary Search Trees 1/9/2014"

Transcription

1 // Som Trminoogis Binry Trs, Binry Srch Trs /st.ppt Chid nd prnt Evry nod xcpt th root hs on prnt A nod cn hv n ritrry numr of chidrn Lvs Nods with no chidrn Siing nods with sm prnt Trs Linr ccss tim of inkd ists is prohiitiv Dos thr xist ny simp dt structur for which th running tim of most oprtions (srch, insrt, dt) is O(og N)? Som Trminoogis Pth Lngth numr of dgs on th pth Dpth of nod ngth of th uniqu pth from th root to tht nod Th dpth of tr is qu to th dpth of th dpst f Hight of nod ngth of th ongst pth from tht nod to f vs r t hight Th hight of tr is qu to th hight of th root Ancstor nd dscndnt Propr ncstor nd propr dscndnt Trs Exmp: UNIX Dirctory A tr is coction of nods Th coction cn mpty (rcursiv dfinition) If not mpty, tr consists of distinguishd nod r (th root), nd zro or mor nonmpty sutrs T, T,..., T k, ch of whos roots r connctd y dirctd dg from r

2 // Binry Trs A tr in which no nod cn hv mor thn two chidrn Th dpth of n vrg inry tr is considry smr thn N, vnthough in th worst cs, th dpth cn s rg s N. Prordr, Postordr nd Inordr Prordr trvrs nod, ft, right prfix xprssion ++*c*+*dfg Exmp: Exprssion Trs Prordr, Postordr nd Inordr Postordr trvrs ft, right, nod postfix xprssion c*+d*f+g*+ Lvs r oprnds (constnts or vris) Th othr nods (intrn nods) contin oprtors Wi not inry tr if som oprtors r not inry Inordr trvrs ft, nod, right. infix xprssion +*c+d*+f*g Tr trvrs Usd to print out th dt in tr in crtin ordr Pr-ordr trvrs Print th dt t th root Rcursivy print out dt in th ft sutr Rcursivy print out dt in th right sutr Prordr

3 // Postordr compr: Impmnttion of gnr tr Prordr, Postordr nd Inordr Binry Srch Trs Stors kys in th nods in wy so tht srching, insrtion nd dtion cn don fficinty. Binry srch tr proprty For vry nod X, th kys in its ft sutr r smr thn th ky vu in X, nd th kys in its right sutr r rgr thn th ky vu in X Binry Trs Binry Srch Trs Possi oprtions on th Binry Tr ADT prnt ft_chid, right_chid siing root, tc Impmnttion Bcus inry tr hs t most two chidrn, w cn kp dirct pointrs to thm A inry srch tr Not inry srch tr

4 // Binry srch trs Two inry srch trs rprsnting th sm st: Avrg dpth of nod is O(og N); mximum dpth of nod is O(N) Impmnttion Srching (Find) Find X: rturn pointr to th nod tht hs ky X, or NULL if thr is no such nod Tim compxity O(hight of th tr) Srching BST If w r srching for, thn w r don. If w r srching for ky <, thn w shoud srch in th ft sutr. If w r srching for ky >, thn w shoud srch in th right sutr. Inordr trvrs of BST Print out th kys in sortd ordr Inordr:,,,,,,,,,,

5 // findmin/ findmx Rturn th nod contining th smst mnt in th tr Strt t th root nd go ft s ong s thr is ft chid. Th stopping point is th smst mnt dt Thr css: () th nod is f Dt it immdity () th nod hs on chid Adjust pointr from th prnt to ypss tht nod Simiry for findmx Tim compxity = O(hight of th tr) insrt Procd down th tr s you woud with find If X is found, do nothing (or updt somthing) Othrwis, insrt X t th st spot on th pth trvrsd dt () th nod hs chidrn rpc th ky of tht nod with th minimum mnt t th right sutr dt th minimum mnt Hs ithr no chid or ony right chid cus if it hs ft chid, tht ft chid woud smr nd woud hv n chosn. So invok cs or. Tim compxity = O(hight of th tr) Tim compxity = O(hight of th tr) dt Whn w dt nod, w nd to considr how w tk cr of th chidrn of th dtd nod. This hs to don such tht th proprty of th srch tr is mintind. Priority Quus Binry Hps homs.cs.wshington.du/~ndrson/ iuc/sids_.../hps.ppt

6 // Rc Quus FIFO: First-In, First-Out Som contxts whr this sms right? Som contxts whr som things shoud owd to skip hd in th in? Appictions of th Priority Quu Sct print jos in ordr of dcrsing ngth Forwrd pckts on routrs in ordr of urgncy Sct most frqunt symos for comprssion Sort numrs, picking minimum first Anything grdy Quus tht Aow Lin Jumping Nd nw ADT Oprtions: Insrt n Itm, Rmov th Bst Itm Potnti Impmnttions insrt dtmin Unsortd ist (Arry) O() O(n) Unsortd ist (Linkd-List) O() O(n) insrt dtmin Sortd ist (Arry) O(n) O()* Sortd ist (Linkd-List) O(n) O() Priority Quu ADT. PQuu dt : coction of dt with priority. PQuu oprtions insrt dtmin. PQuu proprty: for two mnts in th quu, x nd y, if x hs owr priority vu thn y, x wi dtd for y Rc From Lists, Quus, Stcks Us n ADT tht corrsponds to your nds Th right ADT is fficint, whi n ovry gnr ADT provids functionity you rn t using, ut r pying for nywys Hps provid O(og n) worst cs for oth insrt nd dtmin, O() vrg insrt

7 // Binry Hp Proprtis. Structur Proprty. Ordring Proprty Brif intrud: Som Dfinitions: A Prfct inry tr A inry tr with f nods t th sm dpth. A intrn nods hv chidrn. hight h h+ nods h non-vs h vs root(t): vs(t): chidrn(b): prnt(h): siings(e): ncstors(f): dscndnts(g): sutr(c): Tr Rviw A B D E F H J K L Tr T C G I M N Hp Structur Proprty A inry hp is compt inry tr. Compt inry tr inry tr tht is compty fid, with th possi xcption of th ottom v, which is fid ft to right. Exmps: Mor Tr Trminoogy dpth(b): hight(g): dgr(b): rnching fctor(t): Tr T A B C D E F G H I J K L M N Rprsnting Compt Binry Trs in n Arry B C D E F H I J K L impicit (rry) impmnttion: A G From nod i: ft chid: right chid: prnt: A B C D E F G H I J K L

8 // Why this pproch to storg? Hp Insrt(v) Bsic Id:. Put v t nxt f position. Prcot up y rptdy xchnging nod unti no ongr ndd Hp Ordr Proprty Hp ordr proprty: For vry non-root nod X, th vu in th prnt of X is ss thn (or qu to) th vu in X. Insrt: prcot up not hp Hp Oprtions findmin: insrt(v): prcot up. dtmin: prcot down. Insrt Cod (optimizd) void insrt(ojct o) { ssrt(!isfu()); siz++; nwpos = prcotup(siz,o); Hp[nwPos] = o; } int prcotup(int ho, Ojct v) { whi (ho > && v < Hp[ho/]) Hp[ho] = Hp[ho/]; ho /= ; } rturn ho; } runtim: (Cod in ook)

9 // Hp Dtmin Bsic Id:. Rmov root (tht is wys th min!). Put st f nod t root. Find smst chid of nod. Swp nod with its smst chid if ndd.. Rpt stps & unti no swps ndd. Insrt:,,,,,, DtMin: prcot down Dt Structurs Binry Hps DtMin Cod (Optimizd) Ojct dtmin() { ssrt(!isempty()); rturnv = Hp[]; siz--; nwpos = prcotdown(, Hp[siz+]); Hp[nwPos] = Hp[siz + ]; rturn rturnv; } runtim: (cod in ook) int prcotdown(int ho, Ojct v) { whi (*ho <= siz) { ft = *ho; right = ft + ; if (right siz && Hp[right] < Hp[ft]) trgt = right; s trgt = ft; if (Hp[trgt] < v) { Hp[ho] = Hp[trgt]; ho = trgt; } s rk; } rturn ho; } Buiding Hp

10 // Buiding Hp Adding th itms on t tim is O(n og n) in th worst cs I promisd O(n) for tody Buidhp psudocod privt void uidhp() { for ( int i = currntsiz/; i > ; i-- ) prcotdown( i ); } runtim: Working on Hps BuidHp: Foyd s Mthod Wht r th two proprtis of hp? Structur Proprty Ordr Proprty How do w work on hps? Fix th structur Fix th ordr BuidHp: Foyd s Mthod BuidHp: Foyd s Mthod Add mnts ritrriy to form compt tr. Prtnd it s hp nd fix th hp-ordr proprty!

11 // BuidHp: Foyd s Mthod Finy runtim: BuidHp: Foyd s Mthod Mor Priority Quu Oprtions dcrsky givn pointr to n ojct in th quu, rduc its priority vu Soution: chng priority nd incrsky givn pointr to n ojct in th quu, incrs its priority vu Why do w nd pointr? Why not simpy dt vu? Soution: chng priority nd BuidHp: Foyd s Mthod Mor Priority Quu Oprtions Rmov(ojPtr) givn pointr to n ojct in th quu, rmov th ojct from th quu Soution: st priority to ngtiv infinity, prcot up to root nd dtmin FindMx

12 // Fcts out Hps Osrvtions: Finding chid/prnt indx is mutipy/divid y two Oprtions jump widy through th hp Ech prcot stp ooks t ony two nw nods Insrts r t st s common s dtmins Tris hwww.mthcs.mory.du/~chung/fcourss//sy us/ook/powrpoint/tris.ppt Ritis: Division/mutipiction y powrs of two r quy fst Looking t ony two nw pics of dt: d for cch! With hug dt sts, disk ccsss domint miz nimiz z i nimiz mi z nimiz z Tris Cycs to ccss: CPU Cch Mmory Disk Prprocssing Strings Prprocssing th pttrn spds up pttrn mtching quris Aftr prprocssing th pttrn, KMP s gorithm prforms pttrn mtching in tim proportion to th txt siz If th txt is rg, immut nd srchd for oftn (.g., works y Shkspr), w my wnt to prprocss th txt instd of th pttrn A tri is compct dt structur for rprsnting st of strings, such s th words in txt A tris supports pttrn mtching quris in tim proportion to th pttrn siz Tris A Soution: d-hps Ech nod hs d chidrn Sti rprsnt y rry Good choics for d: (choos powr of two for fficincy) fit on st of chidrn in cch in fit on st of chidrn on mmory pg/disk ock Stndrd Tris Th stndrd tri for st of strings S is n ordrd tr such tht: Ech nod ut th root is d with chrctr Th chidrn of nod r phticy ordrd Th pths from th xtrn nods to th root yid th strings of S Exmp: stndrd tri for th st of strings S = { r,, id, u, uy, s, stock, stop } r i d u y Tris k s c t o p

13 // Anysis of Stndrd Tris A stndrd tri uss O(n) spc nd supports srchs, insrtions nd dtions in tim O(dm), whr: n tot siz of th strings in S m siz of th string prmtr of th oprtion d siz of th pht r i d u y Tris k s c t o p Compct Rprsnttion Compct rprsnttion of comprssd tri for n rry of strings: Stors t th nods rngs of indics instd of sustrings Uss O(s) spc, whr s is th numr of strings in th rry Srvs s n uxiiry indx structur,, S[] = s S[] = S[] = S[] =,,,, r s s t o c k S[] = u S[] = h r S[] = S[] = u y i d S[] = S[] = s t o p,,,,,,,,,,,,,,,,,,,,,,,,,, Tris Word Mtching with Tri insrt th words of th txt into tri Ech f is ssocitd w/ on prticur word f stors indics whr ssocitd word gins ( s strts t indx &, f for s stors thos indics) s r? s s t o c k! s u? u y s t o c k! i d s t o c k! i d s t o c k! h r t h? s t o p! Suffix Tri Th suffix tri of string X is th comprssd tri of th suffixs of X m i n i m i z i u h s t i mi nimiz z r d, y, r c p k Tris,,, o miz nimiz z nimiz z Tris Comprssd Tris A comprssd tri hs intrn nods of dgr t st two It is otind from stndrd tri y comprssing chins of r rdundnt nods x. th i nd d in id r rdundnt cus thy signify th sm word id s u y s ck to p Anysis of Suffix Tris Compct rprsnttion of th suffix tri for string X of siz n from n pht of siz d Uss O(n) spc Supports ritrry pttrn mtching quris in X in O(dm) tim, whr m is th siz of th pttrn Cn constructd in O(n) tim m i n i z m i i u t d y o,,,,, r c p,,,,, Tris k Tris

14 // Encoding Tri () A cod is mpping of ch chrctr of n pht to inry cod-word A prfix cod is inry cod such tht no cod-word is th prfix of nothr cod-word An ncoding tri rprsnts prfix cod Ech f stors chrctr Th cod word of chrctr is givn y th pth from th root to th f storing th chrctr ( for ft chid nd for right chid c d Tris c d Huffmn s Agorithm Givn string X, Huffmn s gorithm construct prfix cod th minimizs th siz of th ncoding of X It runs in tim O(n + d og d), whr n is th siz of X nd d is th numr of distinct chrctrs of X A hp-sd priority quu is usd s n uxiiry structur Agorithm HuffmnEncoding(X) Input string X of siz n Output optim ncoding tri for X C distinctchrctrs(x) computfrquncis(c, X) Q nw mpty hp for c C T nw sing-nod tr storing c Q.insrt(gtFrquncy(c), T) whi Q.siz() > f Q.min() T Q.rmovMin() f Q.min() T Q.rmovMin() T join(t, T ) Q.insrt(f + f, T) rturn Q.rmovMin() Tris Encoding Tri () Givn txt string X, w wnt to find prfix cod for th chrctrs of X tht yids sm ncoding for X Frqunt chrctrs shoud hv short cod-words Rr chrctrs shoud hv ong cod-words Exmp X = rcdr T ncods X into its T ncods X into its T T X =rcdr Frquncis c d r c d r Exmp c d r c d r c d r r c d Tris c d r c d r Tris Th End On Mor Oprtion Mrg two hps Add th itms from on into nothr? O(n og n) Strt ovr nd uid it from scrtch? O(n)

15 // CSE : Dt Structurs Priority Quus Lftist Hps & Skw Hps Dfinition: Nu Pth Lngth nu pth ngth (np) of nod x = th numr of nods twn x nd nu in its sutr OR np(x) = min distnc to dscndnt with or chidrn np(nu) = - np(f) = np(sing-chid nod) =??? Equivnt dfinitions:?. np(x) is th hight of rgst compt sutr rootd t x. np(x) = + min{np(ft(x)), np(right(x))} Nw Hp Oprtion: Mrg Givn two hps, mrg thm into on hp first ttmpt: insrt ch mnt of th smr hp into th rgr. runtim: scond ttmpt: conctnt inry hps rrys nd run uidhp. runtim: Lftist Hp Proprtis Hp-ordr proprty prnt s priority vu is to chidrns priority vus rsut: minimum mnt is t th root Lftist proprty For vry nod x, np(ft(x)) np(right(x)) rsut: tr is t st s hvy on th ft s th right Lftist Hps Ar Ths Lftist? Id: Focus hp mintnnc work in on sm prt of th hp Lftist hps:. Most nods r on th ft. A th mrging work is don on th right Evry sutr of ftist tr is ftist!

16 // Right Pth in Lftist Tr is Short (#) Cim: Th right pth is s short s ny in th tr. Proof: (By contrdiction) Pick shortr pth: D < D Sy it divrgs from right pth t x np(l) D - cus of th pth of ngth D - to nu np(r) D - cus vry nod on right pth is ftist D L x R D Mrg two hps (sic id) Put th smr root s th nw root, Hng its ft sutr on th ft. Rcursivy mrg its right sutr nd th othr tr. Lftist proprty t x viotd! Right Pth in Lftist Tr is Short (#) Cim: If th right pth hs r nods, thn th tr hs t st r - nods. Proof: (By induction) Bs cs : r=. Tr hs t st - = nod Inductiv stp : ssum tru for r < r. Prov for tr with right pth t st r.. Right sutr: right pth of r- nods r- - right sutr nods (y induction). Lft sutr: so right pth of ngth t st r- (y prvious sid) r- - ft sutr nods (y induction) Tot tr siz: ( r- -) + ( r- -) + = r - Mrging Two Lftist Hps mrg(t,t ) rturns on ftist hp contining mnts of th two (distinct) ftist hps T nd T mrg T L R T < L mrg R L R L R Why do w hv th ftist proprty? Bcus it gurnts tht: th right pth is ry short comprd to th numr of nods in th tr A ftist tr of N nods, hs right pth of t most g (N+) nods Mrg Continud If np(r ) > np(l ) L R R = Mrg(R, T ) R L Id prform work on th right pth runtim:

17 // Lt s do n xmp, ut first Othr Hp Oprtions insrt? dtmin? Swing Up th Exmp??? Don? Oprtions on Lftist Hps mrg with two trs of tot siz n: O(og n) insrt with hp siz n: O(og n) prtnd nod is siz ftist hp insrt y mrging origin hp with on nod hp mrg Finy dtmin with hp siz n: O(og n) rmov nd rturn root mrg ft nd right sutrs mrg mrg Lftst Mrg Exmp? mrg? mrg (spci cs) Good Bd Lftist Hps: Summry

18 // Rndom Dfinition: Amortizd Tim m or tizd tim: Running tim imit rsuting from writing off xpnsiv runs of n gorithm ovr mutip chp runs of th gorithm, usuy rsuting in owr ovr running tim thn If indictd M oprtions y th tk worst tot O(M possi og N) cs. tim, mortizd tim pr oprtion is O(og N) Diffrnc from vrg tim: mrg Exmp mrg mrg Skw Hps Proms with ftist hps xtr storg for np xtr compxity/ogic to mintin nd chck np right sid is oftn hvy nd rquirs switch Soution: skw hps indy djusting vrsion of ftist hps mrg wys switchs chidrn whn fixing right pth mortizd tim for: mrg, insrt, dtmin = O(og n) howvr, worst cs tim for thr = O(n) Skw Hp Cod void mrg(hp, hp) { cs { hp == NULL: rturn hp; hp == NULL: rturn hp; hp.findmin() < hp.findmin(): tmp = hp.right; hp.right = hp.ft; hp.ft = mrg(hp, tmp); rturn hp; othrwis: rturn mrg(hp, hp); } } mrg T Mrging Two Skw Hps L R T L R < mrg R L R Ony on stp pr itrtion, with chidrn wys switchd L Runtim Anysis: Worst-cs nd Amortizd No worst cs gurnt on right pth ngth! A oprtions ry on mrg worst cs compxity of ops = Proy won t gt to mortizd nysis in this cours, ut s Chptr if curious. Rsut: M mrgs tk tim M og n mortizd compxity of ops =

19 // Binry Hps Compring Hps Lftist Hps Th Binomi Tr, B h B h hs hight h nd xcty h nods B h is formd y mking B h- chid of nothr B h- Root hs xcty h chidrn Numr of nods t dpth d is inomi coff. Hnc th nm; w wi not us this st proprty h d d-hps Skw Hps B B B B Sti room for improvmnt! (Whr?) Dt Structurs Binomi Quus Binomi Quu with n mnts Binomi Q with n mnts hs uniqu structur rprsnttion in trms of inomi trs! Writ n in inry: n = (s ) = (s ) B B No B B Yt Anothr Dt Structur: Binomi Quus Structur proprty Forst of inomi trs with t most on tr of ny hight Wht s forst? Wht s inomi tr? Ordr proprty Ech inomi tr hs th hp-ordr proprty Proprtis of Binomi Quu At most on inomi tr of ny hight n nods inry rprsnttion is of siz? dpst tr hs hight? numr of trs is? Dfin: hight(forst F) = mx tr T in F { hight(t) } Binomi Q with n nods hs hight Θ(og n)

20 // Oprtions on Binomi Quu Wi gin dfin mrg s th s oprtion insrt, dtmin, uidbinomiq wi us mrg Exmp: Binomi Quu Mrg H: H: - Cn w do incrsky fficinty? dcrsky? Wht out findmin? Mrging Two Binomi Quus Essntiy ik dding two inry numrs!. Comin th two forsts. For k from to mxhight {. m tot numr of B k s in th two BQs. if m=: continu; # of s c. if m=: continu; + = d. if m=: comin th two B k s to form + = B k+ + = +c. if m=: rtin on B k nd ++c = +c comin th othr two to form B k+ } Cim: Whn this procss nds, th forst hs t most on tr of ny hight Exmp: Binomi Quu Mrg H: H: - Exmp: Binomi Quu Mrg H: H: Exmp: Binomi Quu Mrg H: H: - -

21 // Exmp: Binomi Quu Mrg H: H: Insrt in Binomi Quu Insrt(x): Simir to ftist or skw hp - runtim Worst cs compxity: sm s mrg O( ) Avrg cs compxity: O() Why?? Hint: Think of dding to Exmp: Binomi Quu Mrg H: H: dtmin in Binomi Quu Simir to ftist nd skw hps. - Compxity of Mrg Constnt tim for ch hight Mx numr of hights is: og n BQ dtmin: Exmp worst cs running tim = Θ( ) find nd dt smst root mrg BQ (without BQ th shdd prt) nd BQ

22 // dtmin: Exmp Rsut: runtim:

CPE702 Algorithm Analysis and Design Week 11 String Processing

CPE702 Algorithm Analysis and Design Week 11 String Processing CPE702 Agorithm Anaysis and Dsign Wk 11 String Procssing Prut Boonma prut@ng.cmu.ac.th Dpartmnt of Computr Enginring Facuty of Enginring, Chiang Mai Univrsity Basd on Sids by M.T. Goodrich and R. Tamassia

More information

Minimum Spanning Trees

Minimum Spanning Trees Minimum Spnning Trs Minimum Spnning Trs Problm A town hs st of houss nd st of rods A rod conncts nd only houss A rod conncting houss u nd v hs rpir cost w(u, v) Gol: Rpir nough (nd no mor) rods such tht:

More information

Indexed Search Tree (Trie)

Indexed Search Tree (Trie) Indxd Sarch Tr (Tri) Fawzi Emad Chau-Wn Tsng Dpartmnt of Computr Scinc Univrsity of Maryand, Cog Park Indxd Sarch Tr (Tri) Spcia cas of tr Appicab whn Ky C can b dcomposd into a squnc of subkys C 1, C

More information

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 23, April 5, 2016

Winter 2016 COMP-250: Introduction to Computer Science. Lecture 23, April 5, 2016 Wintr 2016 COMP-250: Introduction to Computr Scinc Lctur 23, April 5, 2016 Commnt out input siz 2) Writ ny lgorithm tht runs in tim Θ(n 2 log 2 n) in wors cs. Explin why this is its running tim. I don

More information

CSI35 Chapter 11 Review

CSI35 Chapter 11 Review 1. Which of th grphs r trs? c f c g f c x y f z p q r 1 1. Which of th grphs r trs? c f c g f c x y f z p q r . Answr th qustions out th following tr 1) Which vrtx is th root of c th tr? ) wht is th hight

More information

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

CSC Design and Analysis of Algorithms. Example: Change-Making Problem CSC 801- Dsign n Anlysis of Algorithms Ltur 11 Gry Thniqu Exmpl: Chng-Mking Prolm Givn unlimit mounts of oins of nomintions 1 > > m, giv hng for mount n with th lst numr of oins Exmpl: 1 = 25, 2 =10, =

More information

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018 CSE 373: Mor on grphs; DFS n BFS Mihl L Wnsy, F 14, 2018 1 Wrmup Wrmup: Disuss with your nighor: Rmin your nighor: wht is simpl grph? Suppos w hv simpl, irt grph with x nos. Wht is th mximum numr of gs

More information

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata

CSE303 - Introduction to the Theory of Computing Sample Solutions for Exercises on Finite Automata CSE303 - Introduction to th Thory of Computing Smpl Solutions for Exrciss on Finit Automt Exrcis 2.1.1 A dtrministic finit utomton M ccpts th mpty string (i.., L(M)) if nd only if its initil stt is finl

More information

COMP108 Algorithmic Foundations

COMP108 Algorithmic Foundations Grdy mthods Prudn Wong http://www.s.liv..uk/~pwong/thing/omp108/01617 Coin Chng Prolm Suppos w hv 3 typs of oins 10p 0p 50p Minimum numr of oins to mk 0.8, 1.0, 1.? Grdy mthod Lrning outoms Undrstnd wht

More information

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review rmup CSE 7: AVL trs rmup: ht is n invrint? Mihl L Friy, Jn 9, 0 ht r th AVL tr invrints, xtly? Disuss with your nighor. AVL Trs: Invrints Intrlu: Exploring th ln invrint Cor i: xtr invrint to BSTs tht

More information

Tries and Suffix Trees. Inge Li Gørtz

Tries and Suffix Trees. Inge Li Gørtz Tri nd Suffix Tr Ing Li Gørtz String indxing prom String mtcing prom. Givn tring T (txt) nd P (pttrn) ovr n pt Σ, rport trting poition of occurrnc of P in T. Finit utomton: O(mΣ + n) tim nd pc KMP: O(m+n)

More information

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals

Integration Continued. Integration by Parts Solving Definite Integrals: Area Under a Curve Improper Integrals Intgrtion Continud Intgrtion y Prts Solving Dinit Intgrls: Ar Undr Curv Impropr Intgrls Intgrtion y Prts Prticulrly usul whn you r trying to tk th intgrl o som unction tht is th product o n lgric prssion

More information

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, *

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, * CmSc 365 Thory of Computtion Finit Stt Automt nd Rgulr Exprssions (Chptr 2, Sction 2.3) ALPHABET oprtions: U, conctntion, * otin otin Strings Form Rgulr xprssions dscri Closd undr U, conctntion nd * (if

More information

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued...

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued... Progrssiv Printing T.M. CPITLS g 4½+ Th sy, fun (n FR!) wy to tch cpitl lttrs. ook : C o - For Kinrgrtn or First Gr (not for pr-school). - Tchs tht cpitl lttrs mk th sm souns s th littl lttrs. - Tchs th

More information

Similarity Search. The Binary Branch Distance. Nikolaus Augsten.

Similarity Search. The Binary Branch Distance. Nikolaus Augsten. Similrity Srh Th Binry Brnh Distn Nikolus Augstn nikolus.ugstn@sg..t Dpt. of Computr Sins Univrsity of Slzurg http://rsrh.uni-slzurg.t Vrsion Jnury 11, 2017 Wintrsmstr 2016/2017 Augstn (Univ. Slzurg) Similrity

More information

INTEGRALS. Chapter 7. d dx. 7.1 Overview Let d dx F (x) = f (x). Then, we write f ( x)

INTEGRALS. Chapter 7. d dx. 7.1 Overview Let d dx F (x) = f (x). Then, we write f ( x) Chptr 7 INTEGRALS 7. Ovrviw 7.. Lt d d F () f (). Thn, w writ f ( ) d F () + C. Ths intgrls r clld indfinit intgrls or gnrl intgrls, C is clld constnt of intgrtion. All ths intgrls diffr y constnt. 7..

More information

TOPIC 5: INTEGRATION

TOPIC 5: INTEGRATION TOPIC 5: INTEGRATION. Th indfinit intgrl In mny rspcts, th oprtion of intgrtion tht w r studying hr is th invrs oprtion of drivtion. Dfinition.. Th function F is n ntidrivtiv (or primitiv) of th function

More information

Section 3: Antiderivatives of Formulas

Section 3: Antiderivatives of Formulas Chptr Th Intgrl Appli Clculus 96 Sction : Antirivtivs of Formuls Now w cn put th is of rs n ntirivtivs togthr to gt wy of vluting finit intgrls tht is ct n oftn sy. To vlut finit intgrl f(t) t, w cn fin

More information

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list.

Searching Linked Lists. Perfect Skip List. Building a Skip List. Skip List Analysis (1) Assume the list is sorted, but is stored in a linked list. 3 3 4 8 6 3 3 4 8 6 3 3 4 8 6 () (d) 3 Sarching Linkd Lists Sarching Linkd Lists Sarching Linkd Lists ssum th list is sortd, but is stord in a linkd list. an w us binary sarch? omparisons? Work? What if

More information

Last time: introduced our first computational model the DFA.

Last time: introduced our first computational model the DFA. Lctur 7 Homwork #7: 2.2.1, 2.2.2, 2.2.3 (hnd in c nd d), Misc: Givn: M, NFA Prov: (q,xy) * (p,y) iff (q,x) * (p,) (follow proof don in clss tody) Lst tim: introducd our first computtionl modl th DFA. Tody

More information

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp

CSE 373. Graphs 1: Concepts, Depth/Breadth-First Search reading: Weiss Ch. 9. slides created by Marty Stepp CSE 373 Grphs 1: Conpts, Dpth/Brth-First Srh ring: Wiss Ch. 9 slis rt y Mrty Stpp http://www.s.wshington.u/373/ Univrsity o Wshington, ll rights rsrv. 1 Wht is grph? 56 Tokyo Sttl Soul 128 16 30 181 140

More information

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} Introution Computr Sin & Enginring 423/823 Dsign n Anlysis of Algorithms Ltur 03 Elmntry Grph Algorithms (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) I Grphs r strt t typs tht r pplil to numrous

More information

CS 461, Lecture 17. Today s Outline. Example Run

CS 461, Lecture 17. Today s Outline. Example Run Prim s Algorithm CS 461, Ltur 17 Jr Si Univrsity o Nw Mxio In Prim s lgorithm, th st A mintin y th lgorithm orms singl tr. Th tr strts rom n ritrry root vrtx n grows until it spns ll th vrtis in V At h

More information

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)}

V={A,B,C,D,E} E={ (A,D),(A,E),(B,D), (B,E),(C,D),(C,E)} s s of s Computr Sin & Enginring 423/823 Dsign n Anlysis of Ltur 03 (Chptr 22) Stphn Sott (Apt from Vinohnrn N. Vriym) s of s s r strt t typs tht r pplil to numrous prolms Cn ptur ntitis, rltionships twn

More information

Final Exam Solutions

Final Exam Solutions CS 2 Advancd Data Structurs and Algorithms Final Exam Solutions Jonathan Turnr /8/20. (0 points) Suppos that r is a root of som tr in a Fionacci hap. Assum that just for a dltmin opration, r has no childrn

More information

1 Minimum Cut Problem

1 Minimum Cut Problem CS 6 Lctur 6 Min Cut and argr s Algorithm Scribs: Png Hui How (05), Virginia Dat: May 4, 06 Minimum Cut Problm Today, w introduc th minimum cut problm. This problm has many motivations, on of which coms

More information

UNTYPED LAMBDA CALCULUS (II)

UNTYPED LAMBDA CALCULUS (II) 1 UNTYPED LAMBDA CALCULUS (II) RECALL: CALL-BY-VALUE O.S. Basic rul Sarch ruls: (\x.) v [v/x] 1 1 1 1 v v CALL-BY-VALUE EVALUATION EXAMPLE (\x. x x) (\y. y) x x [\y. y / x] = (\y. y) (\y. y) y [\y. y /

More information

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V Unirt Grphs An unirt grph G = (V, E) V st o vrtis E st o unorr gs (v,w) whr v, w in V USE: to mol symmtri rltionships twn ntitis vrtis v n w r jnt i thr is n g (v,w) [or (w,v)] th g (v,w) is inint upon

More information

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems

Roadmap. XML Indexing. DataGuide example. DataGuides. Strong DataGuides. Multiple DataGuides for same data. CPS Topics in Database Systems Roadmap XML Indxing CPS 296.1 Topics in Databas Systms Indx fabric Coopr t al. A Fast Indx for Smistructurd Data. VLDB, 2001 DataGuid Goldman and Widom. DataGuids: Enabling Qury Formulation and Optimization

More information

Strongly Connected Components

Strongly Connected Components Strongly Connctd Componnts Lt G = (V, E) b a dirctd graph Writ if thr is a path from to in G Writ if and is an quivalnc rlation: implis and implis s quivalnc classs ar calld th strongly connctd componnts

More information

EEO 401 Digital Signal Processing Prof. Mark Fowler

EEO 401 Digital Signal Processing Prof. Mark Fowler EEO 401 Digital Signal Procssing Prof. Mark Fowlr Dtails of th ot St #19 Rading Assignmnt: Sct. 7.1.2, 7.1.3, & 7.2 of Proakis & Manolakis Dfinition of th So Givn signal data points x[n] for n = 0,, -1

More information

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs. Pths.. Eulr n Hmilton Pths.. Pth D. A pth rom s to t is squn o gs {x 0, x 1 }, {x 1, x 2 },... {x n 1, x n }, whr x 0 = s, n x n = t. D. Th lngth o pth is th numr o gs in it. {, } {, } {, } {, } {, } {,

More information

Outline. Binary Tree

Outline. Binary Tree Outlin Similrity Srh Th Binry Brnh Distn Nikolus Austn nikolus.ustn@s..t Dpt. o Computr Sins Univrsity o Slzur http://rsrh.uni-slzur.t 1 Binry Brnh Distn Binry Rprsnttion o Tr Binry Brnhs Lowr Boun or

More information

DFA (Deterministic Finite Automata) q a

DFA (Deterministic Finite Automata) q a Big pictur All lngugs Dcidl Turing mchins NP P Contxt-fr Contxt-fr grmmrs, push-down utomt Rgulr Automt, non-dtrministic utomt, rgulr xprssions DFA (Dtrministic Finit Automt) 0 q 0 0 0 0 q DFA (Dtrministic

More information

Preview. Graph. Graph. Graph. Graph Representation. Graph Representation 12/3/2018. Graph Graph Representation Graph Search Algorithms

Preview. Graph. Graph. Graph. Graph Representation. Graph Representation 12/3/2018. Graph Graph Representation Graph Search Algorithms /3/0 Prvw Grph Grph Rprsntton Grph Srch Algorthms Brdth Frst Srch Corrctnss of BFS Dpth Frst Srch Mnmum Spnnng Tr Kruskl s lgorthm Grph Drctd grph (or dgrph) G = (V, E) V: St of vrt (nod) E: St of dgs

More information

Ch 1.2: Solutions of Some Differential Equations

Ch 1.2: Solutions of Some Differential Equations Ch 1.2: Solutions of Som Diffrntil Equtions Rcll th fr fll nd owl/mic diffrntil qutions: v 9.8.2v, p.5 p 45 Ths qutions hv th gnrl form y' = y - b W cn us mthods of clculus to solv diffrntil qutions of

More information

Lecture 11 Waves in Periodic Potentials Today: Questions you should be able to address after today s lecture:

Lecture 11 Waves in Periodic Potentials Today: Questions you should be able to address after today s lecture: Lctur 11 Wvs in Priodic Potntils Tody: 1. Invrs lttic dfinition in 1D.. rphicl rprsnttion of priodic nd -priodic functions using th -xis nd invrs lttic vctors. 3. Sris solutions to th priodic potntil Hmiltonin

More information

Multi-Section Coupled Line Couplers

Multi-Section Coupled Line Couplers /0/009 MultiSction Coupld Lin Couplrs /8 Multi-Sction Coupld Lin Couplrs W cn dd multipl coupld lins in sris to incrs couplr ndwidth. Figur 7.5 (p. 6) An N-sction coupld lin l W typiclly dsign th couplr

More information

Week 3: Connected Subgraphs

Week 3: Connected Subgraphs Wk 3: Connctd Subgraphs Sptmbr 19, 2016 1 Connctd Graphs Path, Distanc: A path from a vrtx x to a vrtx y in a graph G is rfrrd to an xy-path. Lt X, Y V (G). An (X, Y )-path is an xy-path with x X and y

More information

Minimum Spanning Trees

Minimum Spanning Trees Mnmum Spnnng Trs Spnnng Tr A tr (.., connctd, cyclc grph) whch contns ll th vrtcs of th grph Mnmum Spnnng Tr Spnnng tr wth th mnmum sum of wghts 1 1 Spnnng forst If grph s not connctd, thn thr s spnnng

More information

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018

Propositional Logic. Combinatorial Problem Solving (CPS) Albert Oliveras Enric Rodríguez-Carbonell. May 17, 2018 Propositional Logic Combinatorial Problm Solving (CPS) Albrt Olivras Enric Rodríguz-Carbonll May 17, 2018 Ovrviw of th sssion Dfinition of Propositional Logic Gnral Concpts in Logic Rduction to SAT CNFs

More information

Abstract Interpretation: concrete and abstract semantics

Abstract Interpretation: concrete and abstract semantics Abstract Intrprtation: concrt and abstract smantics Concrt smantics W considr a vry tiny languag that manags arithmtic oprations on intgrs valus. Th (concrt) smantics of th languags cab b dfind by th funzcion

More information

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS C 24 - COMBINATIONAL BUILDING BLOCKS - INVST 3 DCODS AND NCODS FALL 23 AP FLZ To o "wll" on this invstition you must not only t th riht nswrs ut must lso o nt, omplt n onis writups tht mk ovious wht h

More information

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory m E x. N o. 3 F I L E M A N A G E M E N T Aim To manag ils and dirctoris using Linux commands. I. F i l M a n a g m n t 1. il Examins th typ o th givn il or dirctory i l i l n a m > ( o r ) < d i r c t

More information

, between the vertical lines x a and x b. Given a demand curve, having price as a function of quantity, p f (x) at height k is the curve f ( x,

, between the vertical lines x a and x b. Given a demand curve, having price as a function of quantity, p f (x) at height k is the curve f ( x, Clculus for Businss nd Socil Scincs - Prof D Yun Finl Em Rviw vrsion 5/9/7 Chck wbsit for ny postd typos nd updts Pls rport ny typos This rviw sht contins summris of nw topics only (This rviw sht dos hv

More information

cycle that does not cross any edges (including its own), then it has at least

cycle that does not cross any edges (including its own), then it has at least W prov th following thorm: Thorm If a K n is drawn in th plan in such a way that it has a hamiltonian cycl that dos not cross any dgs (including its own, thn it has at last n ( 4 48 π + O(n crossings Th

More information

Chapter 16. 1) is a particular point on the graph of the function. 1. y, where x y 1

Chapter 16. 1) is a particular point on the graph of the function. 1. y, where x y 1 Prctic qustions W now tht th prmtr p is dirctl rltd to th mplitud; thrfor, w cn find tht p. cos d [ sin ] sin sin Not: Evn though ou might not now how to find th prmtr in prt, it is lws dvisl to procd

More information

The Matrix Exponential

The Matrix Exponential Th Matrix Exponntial (with xrciss) by Dan Klain Vrsion 28928 Corrctions and commnts ar wlcom Th Matrix Exponntial For ach n n complx matrix A, dfin th xponntial of A to b th matrix () A A k I + A + k!

More information

The Matrix Exponential

The Matrix Exponential Th Matrix Exponntial (with xrciss) by D. Klain Vrsion 207.0.05 Corrctions and commnts ar wlcom. Th Matrix Exponntial For ach n n complx matrix A, dfin th xponntial of A to b th matrix A A k I + A + k!

More information

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example Outlin Computr Sin 33 Computtion o Minimum-Cost Spnnin Trs Prim's Alorithm Introution Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #33 3 Alorithm Gnrl Constrution Mik Joson (Univrsity o Clry)

More information

Weighted Matching and Linear Programming

Weighted Matching and Linear Programming Wightd Mtching nd Linr Progrmming Jonthn Turnr Mrch 19, 01 W v sn tht mximum siz mtchings cn b found in gnrl grphs using ugmnting pths. In principl, this sm pproch cn b pplid to mximum wight mtchings.

More information

CIVL 8/ D Boundary Value Problems - Rectangular Elements 1/7

CIVL 8/ D Boundary Value Problems - Rectangular Elements 1/7 CIVL / -D Boundr Vlu Prolms - Rctngulr Elmnts / RECANGULAR ELEMENS - In som pplictions, it m mor dsirl to us n lmntl rprsnttion of th domin tht hs four sids, ithr rctngulr or qudriltrl in shp. Considr

More information

priority queue ADT heaps 1

priority queue ADT heaps 1 COMP 250 Lctur 23 priority quu ADT haps 1 Nov. 1/2, 2017 1 Priority Quu Li a quu, but now w hav a mor gnral dinition o which lmnt to rmov nxt, namly th on with highst priority..g. hospital mrgncy room

More information

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C

u r du = ur+1 r + 1 du = ln u + C u sin u du = cos u + C cos u du = sin u + C sec u tan u du = sec u + C e u du = e u + C Tchniqus of Intgration c Donald Kridr and Dwight Lahr In this sction w ar going to introduc th first approachs to valuating an indfinit intgral whos intgrand dos not hav an immdiat antidrivativ. W bgin

More information

( ) Geometric Operations and Morphing. Geometric Transformation. Forward v.s. Inverse Mapping. I (x,y ) Image Processing - Lesson 4 IDC-CG 1

( ) Geometric Operations and Morphing. Geometric Transformation. Forward v.s. Inverse Mapping. I (x,y ) Image Processing - Lesson 4 IDC-CG 1 Img Procssing - Lsson 4 Gomtric Oprtions nd Morphing Gomtric Trnsformtion Oprtions dpnd on Pil s Coordints. Contt fr. Indpndnt of pil vlus. f f (, ) (, ) ( f (, ), f ( ) ) I(, ) I', (,) (, ) I(,) I (,

More information

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality: CS2: Grphs Prihr Ch. 4 Rosn Ch. Grphs A olltion of nos n gs Wht n this rprsnt? n A omputr ntwork n Astrtion of mp n Soil ntwork CS2 - Hsh Tls 2 Dirt Grphs Grphs/Ntworks Aroun Us A olltion of nos n irt

More information

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1. Why th Juntion Tr lgorithm? Th Juntion Tr lgorithm hris Willims 1 Shool of Informtis, Univrsity of Einurgh Otor 2009 Th JT is gnrl-purpos lgorithm for omputing (onitionl) mrginls on grphs. It os this y

More information

Basic Polyhedral theory

Basic Polyhedral theory Basic Polyhdral thory Th st P = { A b} is calld a polyhdron. Lmma 1. Eithr th systm A = b, b 0, 0 has a solution or thr is a vctorπ such that π A 0, πb < 0 Thr cass, if solution in top row dos not ist

More information

More Foundations. Undirected Graphs. Degree. A Theorem. Graphs, Products, & Relations

More Foundations. Undirected Graphs. Degree. A Theorem. Graphs, Products, & Relations Mr Funtins Grphs, Pruts, & Rltins Unirt Grphs An unirt grph is pir f 1. A st f ns 2. A st f gs (whr n g is st f tw ns*) Friy, Sptmr 2, 2011 Ring: Sipsr 0.2 ginning f 0.4; Stughtn 1.1.5 ({,,,,}, {{,}, {,},

More information

Errata for Second Edition, First Printing

Errata for Second Edition, First Printing Errt for Scond Edition, First Printing pg 68, lin 1: z=.67 should b z=.44 pg 71: Eqution (.3) should rd B( R) = θ R 1 x= [1 G( x)] pg 1: Eqution (.63) should rd B( R) = x= R = θ ( x R) p( x) R 1 x= [1

More information

Walk Like a Mathematician Learning Task:

Walk Like a Mathematician Learning Task: Gori Dprtmnt of Euction Wlk Lik Mthmticin Lrnin Tsk: Mtrics llow us to prform mny usful mthmticl tsks which orinrily rquir lr numbr of computtions. Som typs of problms which cn b on fficintly with mtrics

More information

CS 361 Meeting 12 10/3/18

CS 361 Meeting 12 10/3/18 CS 36 Mting 2 /3/8 Announcmnts. Homwork 4 is du Friday. If Friday is Mountain Day, homwork should b turnd in at my offic or th dpartmnt offic bfor 4. 2. Homwork 5 will b availabl ovr th wknd. 3. Our midtrm

More information

Homework #3. 1 x. dx. It therefore follows that a sum of the

Homework #3. 1 x. dx. It therefore follows that a sum of the Danil Cannon CS 62 / Luan March 5, 2009 Homwork # 1. Th natural logarithm is dfind by ln n = n 1 dx. It thrfor follows that a sum of th 1 x sam addnd ovr th sam intrval should b both asymptotically uppr-

More information

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013 CS Avn Dt Struturs n Algorithms Exm Solution Jon Turnr //. ( points) Suppos you r givn grph G=(V,E) with g wights w() n minimum spnning tr T o G. Now, suppos nw g {u,v} is to G. Dsri (in wors) mtho or

More information

Instructions for Section 1

Instructions for Section 1 Instructions for Sction 1 Choos th rspons tht is corrct for th qustion. A corrct nswr scors 1, n incorrct nswr scors 0. Mrks will not b dductd for incorrct nswrs. You should ttmpt vry qustion. No mrks

More information

Seven-Segment Display Driver

Seven-Segment Display Driver 7-Smnt Disply Drivr, Ron s in 7-Smnt Disply Drivr, Ron s in Prolm 62. 00 0 0 00 0000 000 00 000 0 000 00 0 00 00 0 0 0 000 00 0 00 BCD Diits in inry Dsin Drivr Loi 4 inputs, 7 outputs 7 mps, h with 6 on

More information

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12

CS61B Lecture #33. Administrivia: Autograder will run this evening. Today s Readings: Graph Structures: DSIJ, Chapter 12 Aministrivi: CS61B Ltur #33 Autogrr will run this vning. Toy s Rings: Grph Struturs: DSIJ, Chptr 12 Lst moifi: W Nov 8 00:39:28 2017 CS61B: Ltur #33 1 Why Grphs? For xprssing non-hirrhilly rlt itms Exmpls:

More information

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths Dt Strutur LECTURE Shortt pth lgorithm Proprti of hortt pth Bllmn-For lgorithm Dijktr lgorithm Chptr in th txtook (pp ). Wight grph -- rminr A wight grph i grph in whih g hv wight (ot) w(v i, v j ) >.

More information

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013

Introduction to Arithmetic Geometry Fall 2013 Lecture #20 11/14/2013 18.782 Introduction to Arithmtic Gomtry Fall 2013 Lctur #20 11/14/2013 20.1 Dgr thorm for morphisms of curvs Lt us rstat th thorm givn at th nd of th last lctur, which w will now prov. Thorm 20.1. Lt φ:

More information

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes. Nm: UCA ID Numr: Stion lttr: th 61 : Disrt Struturs Finl Exm Instrutor: Ciprin nolsu You hv 180 minuts. No ooks, nots or lultors r llow. Do not us your own srth ppr. 1. (2 points h) Tru/Fls: Cirl th right

More information

CONIC SECTIONS. MODULE-IV Co-ordinate Geometry OBJECTIVES. Conic Sections

CONIC SECTIONS. MODULE-IV Co-ordinate Geometry OBJECTIVES. Conic Sections Conic Sctions 16 MODULE-IV Co-ordint CONIC SECTIONS Whil cutting crrot ou might hv noticd diffrnt shps shown th dgs of th cut. Anlticll ou m cut it in thr diffrnt ws, nml (i) (ii) (iii) Cut is prlll to

More information

Errata for Second Edition, First Printing

Errata for Second Edition, First Printing Errt for Scond Edition, First Printing pg 68, lin 1: z=.67 should b z=.44 pg 1: Eqution (.63) should rd B( R) = x= R = θ ( x R) p( x) R 1 x= [1 G( x)] = θp( R) + ( θ R)[1 G( R)] pg 15, problm 6: dmnd of

More information

Higher order derivatives

Higher order derivatives Robrto s Nots on Diffrntial Calculus Chaptr 4: Basic diffrntiation ruls Sction 7 Highr ordr drivativs What you nd to know alrady: Basic diffrntiation ruls. What you can larn hr: How to rpat th procss of

More information

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely . DETERMINANT.. Dtrminnt. Introution:I you think row vtor o mtrix s oorint o vtors in sp, thn th gomtri mning o th rnk o th mtrix is th imnsion o th prlllppi spnn y thm. But w r not only r out th imnsion,

More information

ME 522 PRINCIPLES OF ROBOTICS. FIRST MIDTERM EXAMINATION April 19, M. Kemal Özgören

ME 522 PRINCIPLES OF ROBOTICS. FIRST MIDTERM EXAMINATION April 19, M. Kemal Özgören ME 522 PINCIPLES OF OBOTICS FIST MIDTEM EXAMINATION April 9, 202 Nm Lst Nm M. Kml Özgörn 2 4 60 40 40 0 80 250 USEFUL FOMULAS cos( ) cos cos sin sin sin( ) sin cos cos sin sin y/ r, cos x/ r, r 0 tn 2(

More information

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula

u x v x dx u x v x v x u x dx d u x v x u x v x dx u x v x dx Integration by Parts Formula 7. Intgration by Parts Each drivativ formula givs ris to a corrsponding intgral formula, as w v sn many tims. Th drivativ product rul yilds a vry usful intgration tchniqu calld intgration by parts. Starting

More information

Chapter 6 Folding. Folding

Chapter 6 Folding. Folding Chaptr 6 Folding Wintr 1 Mokhtar Abolaz Folding Th folding transformation is usd to systmatically dtrmin th control circuits in DSP architctur whr multipl algorithm oprations ar tim-multiplxd to a singl

More information

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s? MATH 3012 Finl Exm, My 4, 2006, WTT Stunt Nm n ID Numr 1. All our prts o this prolm r onrn with trnry strings o lngth n, i.., wors o lngth n with lttrs rom th lpht {0, 1, 2}.. How mny trnry wors o lngth

More information

Elliptical motion, gravity, etc

Elliptical motion, gravity, etc FW Physics 130 G:\130 lctur\ch 13 Elliticl motion.docx g 1 of 7 11/3/010; 6:40 PM; Lst rintd 11/3/010 6:40:00 PM Fig. 1 Elliticl motion, grvity, tc minor xis mjor xis F 1 =A F =B C - D, mjor nd minor xs

More information

1 Introduction to Modulo 7 Arithmetic

1 Introduction to Modulo 7 Arithmetic 1 Introution to Moulo 7 Arithmti Bor w try our hn t solvin som hr Moulr KnKns, lt s tk los look t on moulr rithmti, mo 7 rithmti. You ll s in this sminr tht rithmti moulo prim is quit irnt rom th ons w

More information

EECE 301 Signals & Systems Prof. Mark Fowler

EECE 301 Signals & Systems Prof. Mark Fowler EECE 301 Signals & Systms Prof. Mark Fowlr ot St #21 D-T Signals: Rlation btwn DFT, DTFT, & CTFT 1/16 W can us th DFT to implmnt numrical FT procssing This nabls us to numrically analyz a signal to find

More information

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs Outlin Computr Sin 33 Computtion o Minimum-Cost Spnnin Trs Prim s Mik Joson Dprtmnt o Computr Sin Univrsity o Clry Ltur #34 Introution Min-Cost Spnnin Trs 3 Gnrl Constrution 4 5 Trmintion n Eiiny 6 Aitionl

More information

This Week. Computer Graphics. Introduction. Introduction. Graphics Maths by Example. Graphics Maths by Example

This Week. Computer Graphics. Introduction. Introduction. Graphics Maths by Example. Graphics Maths by Example This Wk Computr Grphics Vctors nd Oprtions Vctor Arithmtic Gomtric Concpts Points, Lins nd Plns Eploiting Dot Products CSC 470 Computr Grphics 1 CSC 470 Computr Grphics 2 Introduction Introduction Wh do

More information

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari Grphs CSC 1300 Disrt Struturs Villnov Univrsity Grphs Grphs r isrt struturs onsis?ng of vr?s n gs tht onnt ths vr?s. Grphs n us to mol: omputr systms/ntworks mthm?l rl?ons logi iruit lyout jos/prosss f

More information

CS 103 BFS Alorithm. Mark Redekopp

CS 103 BFS Alorithm. Mark Redekopp CS 3 BFS Aloritm Mrk Rkopp Brt-First Sr (BFS) HIGHLIGHTED ALGORITHM 3 Pt Plnnin W'v sn BFS in t ontxt o inin t sortst pt trou mz? S?? 4 Pt Plnnin W xplor t 4 niors s on irtion 3 3 3 S 3 3 3 3 3 F I you

More information

Linear Algebra Existence of the determinant. Expansion according to a row.

Linear Algebra Existence of the determinant. Expansion according to a row. Lir Algbr 2270 1 Existc of th dtrmit. Expsio ccordig to row. W dfi th dtrmit for 1 1 mtrics s dt([]) = (1) It is sy chck tht it stisfis D1)-D3). For y othr w dfi th dtrmit s follows. Assumig th dtrmit

More information

EEO 401 Digital Signal Processing Prof. Mark Fowler

EEO 401 Digital Signal Processing Prof. Mark Fowler EEO 401 Digital Signal Procssing Prof. Mark Fowlr ot St #18 Introduction to DFT (via th DTFT) Rading Assignmnt: Sct. 7.1 of Proakis & Manolakis 1/24 Discrt Fourir Transform (DFT) W v sn that th DTFT is

More information

CS 241 Analysis of Algorithms

CS 241 Analysis of Algorithms CS 241 Anlysis o Algorithms Prossor Eri Aron Ltur T Th 9:00m Ltur Mting Lotion: OLB 205 Businss HW6 u lry HW7 out tr Thnksgiving Ring: Ch. 22.1-22.3 1 Grphs (S S. B.4) Grphs ommonly rprsnt onntions mong

More information

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation.

Fourier Transforms and the Wave Equation. Key Mathematics: More Fourier transform theory, especially as applied to solving the wave equation. Lur 7 Fourir Transforms and th Wav Euation Ovrviw and Motivation: W first discuss a fw faturs of th Fourir transform (FT), and thn w solv th initial-valu problm for th wav uation using th Fourir transform

More information

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths. How os it work? Pl vlu o imls rprsnt prts o whol numr or ojt # 0 000 Tns o thousns # 000 # 00 Thousns Hunrs Tns Ons # 0 Diml point st iml pl: ' 0 # 0 on tnth n iml pl: ' 0 # 00 on hunrth r iml pl: ' 0

More information

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages:

CS 6353 Compiler Construction, Homework #1. 1. Write regular expressions for the following informally described languages: CS 6353 Compilr Construction, Homwork #1 1. Writ rgular xprssions for th following informally dscribd languags: a. All strings of 0 s and 1 s with th substring 01*1. Answr: (0 1)*01*1(0 1)* b. All strings

More information

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management nrl tr T is init st o on or mor nos suh tht thr is on sint no r, ll th root o T, n th rminin nos r prtition into n isjoint susts T, T,, T n, h o whih is tr, n whos roots r, r,, r n, rsptivly, r hilrn o

More information

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1 CSC 00 Disrt Struturs : Introuon to Grph Thory Grphs Grphs CSC 00 Disrt Struturs Villnov Univrsity Grphs r isrt struturs onsisng o vrs n gs tht onnt ths vrs. Grphs n us to mol: omputr systms/ntworks mthml

More information

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1

Abstract Interpretation. Lecture 5. Profs. Aiken, Barrett & Dill CS 357 Lecture 5 1 Abstract Intrprtation 1 History On brakthrough papr Cousot & Cousot 77 (?) Inspird by Dataflow analysis Dnotational smantics Enthusiastically mbracd by th community At last th functional community... At

More information

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura Moul grph.py CS 231 Nomi Nishimur 1 Introution Just lik th Python list n th Python itionry provi wys of storing, ssing, n moifying t, grph n viw s wy of storing, ssing, n moifying t. Bus Python os not

More information

Mor Tutorial at www.dumblittldoctor.com Work th problms without a calculator, but us a calculator to chck rsults. And try diffrntiating your answrs in part III as a usful chck. I. Applications of Intgration

More information

Association (Part II)

Association (Part II) Association (Part II) nanopoulos@ismll.d Outlin Improving Apriori (FP Growth, ECLAT) Qustioning confidnc masur Qustioning support masur 2 1 FP growth Algorithm Us a comprssd rprsntation of th dtb databas

More information

Hydrogen Atom and One Electron Ions

Hydrogen Atom and One Electron Ions Hydrogn Atom and On Elctron Ions Th Schrödingr quation for this two-body problm starts out th sam as th gnral two-body Schrödingr quation. First w sparat out th motion of th cntr of mass. Th intrnal potntial

More information

Math 34A. Final Review

Math 34A. Final Review Math A Final Rviw 1) Us th graph of y10 to find approimat valus: a) 50 0. b) y (0.65) solution for part a) first writ an quation: 50 0. now tak th logarithm of both sids: log() log(50 0. ) pand th right

More information

PH427/PH527: Periodic systems Spring Overview of the PH427 website (syllabus, assignments etc.) 2. Coupled oscillations.

PH427/PH527: Periodic systems Spring Overview of the PH427 website (syllabus, assignments etc.) 2. Coupled oscillations. Dy : Mondy 5 inuts. Ovrviw of th PH47 wsit (syllus, ssignnts tc.). Coupld oscilltions W gin with sss coupld y Hook's Lw springs nd find th possil longitudinl) otion of such syst. W ll xtnd this to finit

More information