implementation sequential search (unordered list) binary search (ordered array) BST N N N log N log N N compareto()

Size: px
Start display at page:

Download "implementation sequential search (unordered list) binary search (ordered array) BST N N N log N log N N compareto()"

Transcription

1 OBT DGWIK KVIN WYN lgorithms OBT DGWIK KVIN WYN ymol tle review lgorithms F O U T D I T I O N BND T 2 3 serh trees red lk BTs B-trees implementtion sequentil serh (unordered list) inry serh (ordered rry) gurntee serh insert delete hllenge. Gurntee performne. serh verge se This leture. 2 3 trees, left-lening red lk BTs, B-trees. hit insert delete ordered ops? key interfe N N N N N N equls() log N N N log N N N ompreto() BT N N N log N log N N ompreto() gol log N log N log N log N log N log N ompreto() st updted on 2/28/16 9: tree lgorithms 3.3 BND T 2 3 serh trees red lk BTs B-trees ymmetri order. Inorder trversl yields keys in sending order. erfet lne. very pth from root to null link hs sme length. llow 1 or 2 keys per node. 2-node: one key, two hildren. 3-node: two keys, three hildren. smller thn 3-node J lrger thn J 2-node OBT DGWIK KVIN WYN etween nd J null link 4

2 2 3 tree demo 2 3 tree demo: insertion erh. ompre serh key ginst keys in node. Find intervl ontining serh key. Follow ssoited link (reursively). Insert into 2-node t ottom. erh for key, s usul. eple 2-node with 3-node. serh for insert K K is less thn (go left) K J J tree demo: insertion Insert into 2-node t ottom. erh for key, s usul. eple 2-node with 3-node. 2 3 tree demo: insertion Insert into 2-node t ottom. erh for key, s usul. eple 2-node with 3-node. insert K insert K K is greter thn J (go right) K J J K serh ends here

3 2 3 tree demo: insertion 2 3 tree demo: insertion Insert into 2-node t ottom. erh for key, s usul. eple 2-node with 3-node. Insert into 2-node t ottom. erh for key, s usul. eple 2-node with 3-node. insert K insert K J J K K reple 2-node with 3-node ontining K 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. insert Z Z is greter thn (go right) insert Z Z Z is greter thn (go right) J J Z K K

4 2 3 tree demo: insertion 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. insert Z insert Z J J K Z K Z serh ends here reple 3-node with temporry 4-node ontining Z 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. insert Z insert Z J J K Z K Z split 4-node into two 2-nodes (pss middle key to prent)

5 2 3 tree demo: insertion 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. insert Z insert Z J J K Z K Z 2 3 tree demo: insertion 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. insert insert onvert 3-node into 4-node

6 2 3 tree demo: insertion 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. insert insert split 4-node (move to prent) 2 3 tree demo: insertion 2 3 tree demo: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. insert insert height of tree inreses y 1 split 4-node (move to prent)

7 2 3 tree demo: insertion 2 3 tree: insertion Insert into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. Insertion into 2-node t ottom. dd new key to 2-node to rete 3-node. Insertion into 3-node t ottom. dd new key to 3-node to rete temporry 4-node. ove middle key in 4-node into prent. epet up the tree, s neessry. If you reh the root nd it's 4-node, split it into three 2-nodes. root insert rtie: drw the 2-3 tree onstrution for 26 insert 2 3 tree

8 insert insert onvert 2-node into 3-node 2 3 tree insert onvert 3-node into 4-node

9 insert insert split 4-node (move to prent) insert 2 3 tree

10 insert insert onvert 2-node into 3-node 2 3 tree insert onvert 2-node into 3-node

11 insert 2 3 tree insert insert onvert 3-node into 4-node

12 insert insert split 4-node (move to prent) 2 3 tree insert onvert 2-node into 3-node

13 insert 2 3 tree insert insert onvert 2-node into 3-node

14 2 3 tree insert onvert 3-node into 4-node insert insert split 4-node (move to prent)

15 insert insert split 4-node (move to prent) insert 2 3 tree

16 insert insert onvert 2-node into 3-node onvert 2-node into 3-node 2 3 tree: glol properties Invrints. intins symmetri order nd perfet lne. f. h trnsformtion mintins symmetri order nd perfet lne. 2-3 tree root prent is 3-node left d e omework: verify this d e prent is 2-node left d d middle e d e d right right d d d d e e 64

17 2 3 tree: performne Blned serh trees: quiz 1 plitting 4-node is lol trnsformtion: onstnt numer of opertions. Wht is the height of 2 3 tree with N keys in the worst se? e d. ~ log3 N B. ~ log2 N. ~ 2 log2 N less thn etween nd etween nd etween nd d etween d nd e greter thn e D. ~ N. I don't know. e d less thn etween nd etween nd etween nd d etween d nd e greter thn e tree: performne T implementtions: summry erfet lne. very pth from root to null link hs sme length. Tree height. Worst se: lg N. Best se: [ll 2-nodes] log3 N.631 lg N. [ll 3-nodes] Between 12 nd 20 for million nodes. Between 18 nd 30 for illion nodes. Bottom line. Gurnteed logrithmi performne for serh nd insert. implementtion sequentil serh (unordered list) inry serh (ordered rry) gurntee serh insert delete serh hit verge se insert delete ordered ops? key interfe N N N N N N equls() log N N N log N N N ompreto() BT N N N log N log N N ompreto() 2 3 tree log N log N log N log N log N log N ompreto() ut hidden onstnt is lrge (depends upon implementtion) 67 68

18 2 3 tree: implementtion? Diret implementtion is omplited, euse: intining multiple node types is umersome. Need multiple ompres to move down tree. Need to move k up the tree to split 4-nodes. rge numer of ses for splitting. 3.3 B ND T 2 3 serh trees red lk BTs Beutiful lgorithms re not lwys the most useful. B-trees lgorithms Donld Knuth left-lening version optimized for tehing nd oding; developed y Bo edgewik in reting this ourse! OBT DGWIK K VIN W YN Bottom line. ould do it, ut there's etter wy. 69 ow to implement 2 3 trees with inry trees? eft-lening red lk BTs (Guis-edgewik 1979 nd edgewik 2007) 3-node hllenge. ow to represent 3 node? red lk tree nnot mp from BT k to 2 3 tree. 2. Use "internl"left-lening links s "glue" 3 nodes. greter less for etween thn thn nd J pproh 1. egulr BT. No wy to tell 3-node from 2-node. 3-node etween nd J less thn less thn red lk tree J 2 3 tree lk links onnet 2-nodes nd 3-nodes red links "glue" nodes within 3-node noding 3-node with two 2-nodes onneted y left-lening red link greter thn etween nd noding 3-node with two 2-nodes onneted y left-lening red link thn J Widely used in prtie. ritrry restrition: red links len left. greter thn greter etween nd lrger key is root 2-3 tree pproh 3. egulr BT with red "glue" links. less thn pproh 2. egulr BT with red "glue" nodes. horizontl red links Wstes spe, wsted link. ode proly messy. 1. epresent 2 3 tree s BT. orresponding red lk BT 1 1 orrespondene etween red-lk nd 2-3 trees horizontl red links J 2-3 tree J

19 eft-lening red lk BTs: 1 1 orrespondene with 2 3 trees Definition of left-lening red-lk tree Key property. 1 1 orrespondene etween 2 3 nd B. BT suh tht: red lk red lk tree tree No node hs two red links onneted to it. very pth from root to null link hs the sme numer of lk links. ed links len left. "perfet lk lne" J red lk tree J horizontl horizontl red red links links J tree tree horizontl red links J J orrespondene orrespondene etween etween red-lk nd 2-3 trees tree J erh implementtion for red lk BTs ed lk BT representtion Oservtion. erh is the sme s for elementry BT (ignore olor). Q. ow to represent olor of links in Jv dt struture? 1 1 orrespondene etween red-lk nd 2-3 trees ut runs fster euse of etter lne h node is pointed to y preisely one link (from its prent) n enode olor of links in nodes. puli Vlue get(key key) { Node x = root; while (x!= null) { int mp = key.ompreto(x.key); if (mp < 0) x = x.left; else if (mp > 0) x = x.right; else if (mp == 0) return x.vl; } return null; red lk tree privte stti finl oolen D = true; privte stti finl oolen BK = flse; J privte lss Node { Key key; Vlue vl; Node left, right; oolen olor; // olor of prent link } horizontl red links } J privte oolen ised(node x) { 2-3 tree if (x == null) return flse; return x.olor == D; } emrk. ost other ops (e.g., floor, itertion, seletion) Jre lso identil. null links re lk h h.left.olor is D J D h.right.olor is BK G privte stti finl oolen D = true; privte stti finl oolen BK = flse; privte lss Node { Key key; Vlue vl; Node left, right; int N; oolen olor; orrespondene etween red-lk nd 2-3 trees } Node(Key key, { this.key this.vl this.n this.olor } // // // // // // key ssoited dt sutrees # nodes in this sutree olor of link from prent to this node Vlue vl) = = = = key; vl; 1; D; privte oolen ised(node x) { if (x == null) return flse; 76

20 lementry red lk BT opertions lementry red lk BT opertions eft rottion. Orient (temporrily) right-lening red link to len left. eft rottion. Orient (temporrily) right-lening red link to len left. rotte left (efore) less thn h etween nd x greter thn rotte left (fter) less thn h etween nd x greter thn privte Node rotteeft(node h) { ssert ised(h.right); Node x = h.right; h.right = x.left; x.left = h; x.olor = h.olor; h.olor = D; return x; } kipped in lss Invrints. intins symmetri order nd perfet lk lne. Invrints. intins symmetri order nd perfet lk lne lementry red lk BT opertions ight rottion. Orient left-lening red link to (temporrily) len right. lementry red lk BT opertions ight rottion. Orient left-lening red link to (temporrily) len right. rotte right (efore) less thn x etween nd h greter thn rotte right (fter) less thn x etween nd h greter thn privte Node rotteight(node h) { ssert ised(h.left); Node x = h.left; h.left = x.right; x.right = h; x.olor = h.olor; h.olor = D; return x; } kipped in lss Invrints. intins symmetri order nd perfet lk lne. Invrints. intins symmetri order nd perfet lk lne

21 lementry red lk BT opertions lementry red lk BT opertions olor flip. eolor to split (temporry) 4-node. olor flip. eolor to split (temporry) 4-node. flip olors flip olors (efore) (fter) h h less thn etween nd etween nd greter thn less thn Invrints. intins symmetri order nd perfet lk lne. privte void flipolors(node h) { ssert!ised(h); ssert ised(h.left); ssert ised(h.right); h.olor = D; h.left.olor = BK; h.right.olor = BK; } etween nd pe d k i p l s s in etween nd greter thn Invrints. intins symmetri order nd perfet lk lne. 81 left 82 root serh ends t this null link Insertion into B tree Insertion into B tree root Wrmup 1. Insert into tree with extly 1 node. left root right root right root serh ends t this null link red link to new node ontining onverts 2-node to 3-node lrger serh ends t this null link tthed new node with red link root rotted left to mke legl 3-node Insert into single 2-node (two ses) lrger rotted left to mke legl 3-node Insert into single 2-node (two ses) lrger smller etween smller etween etween serh ends serh ends serh ends t this null link t this t thisends null linknull link serh serh endsserh ends t this null link t this null link smller serhends t this null link serh ends serh ends t this t this null link link null t this null link tthed new tthed new tthed new tthed new node with node with tthed new node with tthed red link new node with red link node with red link node with red link tthed new tthed new red link node red withlink tthed newnode with red link node with red link red link rotted rotted left rotted right rotted left flipped right olors rotted to lk rotted rotted left olors flipped right right rotted olors flipped to lk right lk to rotted olors flipped to lk right olors flipped olors flipped to lk to lk olors flipped olors flipped to lk to lk tthed new node with red link root Wrmup 2. Insert into tree with extly 2 nodes. root serh ends t this null link red link to new node ontining onverts 2-node to 3-node olors flipped to lk Insert into single 3-node (three ses) Insert into single 3-node (three ses) Insert into single 3-node (three ses)

22 Insertion into B tree Generl se. Do stndrd BT insert; olor new link red. epet until needed: Two left red links in row: rotte right. inserting dd new node here two lefts right link red oth hildren red so flip olors node here two lefts in row so rotte right right link red so rotte left ed lk BT onstrution prtie: insert to mintin symmetri order nd perfet lk lne to fix olor invrints Insert into 3-node 85 Insertion into B tree: pssing red links up the tree Generl se. right link red oth hildren so rotte left red so to mintin symmetri order flip olors Do stndrd BT insert; olor new link red. inserting nd perfet lk lne right link red epet until needed: so rotte left two lefts in row inserting so rotte right Two left red links in row: rotte right. dd new to fix olor invrints node here inserting Both hildren red: flip olors. two lefts in row so rotte right dd new inserting node here oth hildren oth hildren red red so so flip olors flip olors dd new node here right link red oth hildren red so oth rotte hildren left so flip olors red so dd new flip olors node here oth hildren right link red red so so rotte flip olors left two lefts in row right link red so rotte right so rotte left two lefts in row ssing red link up the tree so rotte right two lefts in row oth hildren red so rotte right so flip olors ssing red link up the tree two lefts in row so rotte right oth hildren red so flip olors oth hildren red so flip olors oth hildren red so flip olors ssing red link up the tree ssing red link up the tree insert ssing red link up the tree ed-lk BT onstrution demo inserting inserting dd new node here dd new node here oth hildren red so flip olors 86 ssing red link up the tree Do stndrd BT insert; olor new link red. epet until needed: 87 Do stndrd BT insert; olor new link red. epet until needed:

23 ed-lk BT onstrution demo ed-lk BT onstrution demo insert insert Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo insert two left reds in row (rotte right) oth hildren red (flip olors) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

24 ed-lk BT onstrution demo ed-lk BT onstrution demo oth hildren red (flip olors) red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT insert Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

25 ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo insert right link red (rotte left) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

26 ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT insert Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

27 ed-lk BT onstrution demo ed-lk BT onstrution demo two left reds in row (rotte right) oth hildren red (flip olors) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo right link red (rotte left) red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

28 ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo insert insert right link red (rotte left) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

29 ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT insert Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

30 ed-lk BT onstrution demo ed-lk BT onstrution demo insert red-lk BT right link red (rotte left) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo insert right link red (rotte left) two red hildren (flip olors) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

31 ed-lk BT onstrution demo ed-lk BT onstrution demo two left reds in row (rotte right) two red hildren (flip olors) Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: ed-lk BT onstrution demo ed-lk BT onstrution demo two red hildren (flip olors) red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed:

32 ed-lk BT onstrution demo ed-lk BT onstrution demo red-lk BT red-lk BT Do stndrd BT insert; olor new link red. epet until needed: Do stndrd BT insert; olor new link red. epet until needed: Insertion into B tree: Jv implementtion Insertion into B tree: visuliztion me ode for ll ses. ight hild red, left hild lk: rotte left. eft hild, left-left grndhild red: rotte right. Both hildren red: flip olors. kipped in lss h right rotte h left rotte h flip olors privte Node put(node h, Key key, Vlue vl) { if (h == null) return new Node(key, vl, D); int mp = key.ompreto(h.key); if (mp < 0) h.left = put(h.left, key, vl); else if (mp > 0) h.right = put(h.right, key, vl); else if (mp == 0) h.vl = vl; ssing red link up red-lk tree insert t ottom (nd olor it red) if (ised(h.right) &&!ised(h.left)) h = rotteeft(h); if (ised(h.left) && ised(h.left.left)) h = rotteight(h); if (ised(h.left) && ised(h.right)) flipolors(h); len left lne 4-node split 4-node 255 insertions in sending order } return h; only few extr lines of ode provides ner-perfet lne

33 Insertion into B tree: visuliztion Insertion into B tree: visuliztion 255 rndom insertions 255 insertions in desending order Blned serh trees: quiz 2 Wht is the height of B tree with N keys in the worst se?. ~ log3 N B. ~ log2 N. ~ 2 log2 N D. ~ N. I don't know. n out of time out here Blne in B trees roposition. eight of tree is 2 lg N in the worst se. f. Blk height = height of orresponding 2 3 tree lg N. Never two red links in--row. roperty. eight of tree is ~ 1.0 lg N in typil pplitions

34 T implementtions: summry Wr story: why red lk? implementtion sequentil serh (unordered list) gurntee serh insert delete serh hit verge se insert delete ordered ops? key interfe N N N N N N equls() inry serh (ordered rry) log N N N log N N N ompreto() BT N N N log N log N N ompreto() 2 3 tree log N log N log N log N log N log N ompreto() erox innovtions. [1970s] lto. GUI. thernet. mlltlk. Interress. ser printing. Bitmpped disply. WYIWYG text editor.... DIlIOlV1TI FUl\l\V()K Fon BND T erox lto red lk BT log N log N log N log N log N log N ompreto() eo J. Guis.erox lo lto eserh enter, lo lto, liforni, nd rnegie-fellon University nd oert edgewik* rogrm in omputer iene Brown University rovidene,. I. hidden onstnt is smll (t most 2 lg N ompres) 133 BTUT I() this pper we present uniform frmework for the implementtion nd study of hlned tree lgorithms. \Ve show how to imhd in this the wy down towrds lef. s we will see, this hs numer of signifint dvntges ovr the older methods. We shll xmine numhr of vritions on ommon theme nd exhiit full implementtions whih re notle for their rvity. One imp1n1enttion is extnined refully, nd some properties out its 134 Wr story: red lk BTs Telephone ompny ontrted with dtse provider to uild rel-time dtse to store ustomer informtion. Dtse implementtion. ed Blk BT. xeeding height limit of 80 triggered error-reovery proess. xtended telephone servie outge. in use = height ound exeeded! Telephone ompny sues dtse provider. egl testimony: show llow for for up to 2 40 keys If implemented properly, the height of red lk BT with N keys is t most 2 lg N. expert witness did not relne BT during delete lgorithms OBT DGWIK KVIN WYN BND T 2 3 serh trees red lk BTs B-trees type of Blned tree (o-)invented y udolf Byer while working t Boeing 135

35 File system model B-trees (Byer-reight, 1972) ge. ontiguous lok of dt (e.g., 4,096-yte hunk). roe. First ess to pge (e.g., from disk to memory). slow fst roperty. Time required for proe is muh lrger thn time to ess dt within pge. ost model. Numer of proes. Gol. ess dt using minimum numer of proes. B-tree. Generlize 2 3 trees y llowing up to keys per node. t lest / 2 keys in ll nodes (exept root). very pth from root to lef hs sme numer of links. G U B-tree ( = 6) hoose s lrge s possile so tht keys fit in pge ( = 1,024 is typil) D F I J K O Q T V W Y Z erh in B-tree trt t root. hek if node ontins key. Otherwise, find intervl for serh key nd tke orresponding link. ould use inry serh (ut ll ops re onsidered free) Insertion in B-tree erh for new key. Insert t ottom. plit nodes with + 1 keys on the wy k up the B-tree (moving middle key to prent). G U G U D F I J K O Q T V W Y Z D F I J K O Q T V W Y Z B-tree ( = 6) B-tree ( = 6)

36 Blne in B-tree Blned serh trees: quiz 3 roposition. serh or n insertion in B-tree of order with N keys requires etween ~ log N nd ~ log /2 N proes. f. ll nodes (exept possily root) hve etween / 2 nd keys. In prtie. Numer of proes is t most 4. = 1024; N = 62 illion log /2 N 4 Wht of the following does the B in B-tree not men?. Byer B. Blned. Binry D. Boeing. I don't know. the more you think out wht the B in B-trees ould men, the more you lern out B-trees nd tht is good. udolph Byer Blned trees in the wild ed Blk trees re widely used s system symol tles. Jv: jv.util.treep, jv.util.treeet. ++ T: mp, multimp, multiset. inux kernel: ompletely fir sheduler, linux/rtree.h. ms: onservtive stk snning. B-tree ousins. B+ tree, B*tree, B# tree, B-trees (nd ousins) re widely used for file systems nd dtses. Windows: NTF. : F, F+. inux: eiserf, F, xt3f, JF, BTF. Dtses: O, DB2, ING, Q, ostgreq. 143

Balanced Trees. 2-3 trees red-black trees B-trees. 2-3 trees red-black trees B-trees smaller than. 2-node. 3-node E J S X A C.

Balanced Trees. 2-3 trees red-black trees B-trees. 2-3 trees red-black trees B-trees smaller than. 2-node. 3-node E J S X A C. ymol tle review Blned Trees implementtion gurntee verge se serh insert delete serh hit insert delete ordered itertion? opertions on keys sequentil serh (linked list) N N N N/2 N N/2 no equls() 2-3 trees

More information

2-3 search trees red-black BSTs B-trees

2-3 search trees red-black BSTs B-trees 2-3 serch trees red-lck BTs B-trees 3 2-3 tree llow 1 or 2 keys per node. 2-node: one key, two children. 3-node: two keys, three children. ymmetric order. Inorder trversl yields keys in scending order.

More information

4.3 Balanced Trees. let us assume that we can manipulate them conveniently and see how they can be put together to form trees.

4.3 Balanced Trees. let us assume that we can manipulate them conveniently and see how they can be put together to form trees. 428 T FOU 4.3 Blned Trees T BT GOIT IN T VIOU setion work well for wide vriety of pplitions, ut they hve poor worst-se performne. s we hve noted, files lredy in order, files in reverse order, files with

More information

Algorithms. Algorithms 3.3 BALANCED SEARCH TREES. 2 3 search trees red black BSTs B-trees (see book or videos) ROBERT SEDGEWICK KEVIN WAYNE

Algorithms. Algorithms 3.3 BALANCED SEARCH TREES. 2 3 search trees red black BSTs B-trees (see book or videos) ROBERT SEDGEWICK KEVIN WAYNE lgorithms OBT DGWICK KVIN WYN 3.3 BLNCD C T lgorithms F O U T D I T I O N 2 3 search trees red black BTs B-trees (see book or videos) OBT DGWICK KVIN WYN http://algs4.cs.princeton.edu Last updated on 10/17/17

More information

Algorithms. Algorithms 3.3 BALANCED SEARCH TREES. 2 3 search trees red black BSTs ROBERT SEDGEWICK KEVIN WAYNE.

Algorithms. Algorithms 3.3 BALANCED SEARCH TREES. 2 3 search trees red black BSTs ROBERT SEDGEWICK KEVIN WAYNE. lgorithms OBT DGWICK KVIN WYN 3.3 BLNCD C T 2 3 search trees red black BTs lgorithms F O U T D I T I O N OBT DGWICK KVIN WYN http://algs4.cs.princeton.edu Last updated on 10/11/16 9:22 M BT: ordered symbol

More information

CS 241 Week 4 Tutorial Solutions

CS 241 Week 4 Tutorial Solutions CS 4 Week 4 Tutoril Solutions Writing n Assemler, Prt & Regulr Lnguges Prt Winter 8 Assemling instrutions utomtilly. slt $d, $s, $t. Solution: $d, $s, nd $t ll fit in -it signed integers sine they re 5-it

More information

Advanced Programming Handout 5. Enter Okasaki. Persistent vs. Ephemeral. Functional Queues. Simple Example. Persistent vs.

Advanced Programming Handout 5. Enter Okasaki. Persistent vs. Ephemeral. Functional Queues. Simple Example. Persistent vs. Avne Progrmming Hnout 5 Purel Funtionl Dt Strutures: A Cse Stu in Funtionl Progrmming Persistent vs. Ephemerl An ephemerl t struture is one for whih onl one version is ville t time: fter n upte opertion,

More information

Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms

Paradigm 5. Data Structure. Suffix trees. What is a suffix tree? Suffix tree. Simple applications. Simple applications. Algorithms Prdigm. Dt Struture Known exmples: link tble, hep, Our leture: suffix tree Will involve mortize method tht will be stressed shortly in this ourse Suffix trees Wht is suffix tree? Simple pplitions History

More information

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal

CS 551 Computer Graphics. Hidden Surface Elimination. Z-Buffering. Basic idea: Hidden Surface Removal CS 55 Computer Grphis Hidden Surfe Removl Hidden Surfe Elimintion Ojet preision lgorithms: determine whih ojets re in front of others Uses the Pinter s lgorithm drw visile surfes from k (frthest) to front

More information

COMP108 Algorithmic Foundations

COMP108 Algorithmic Foundations Grph Theory Prudene Wong http://www.s.liv..uk/~pwong/tehing/omp108/201617 How to Mesure 4L? 3L 5L 3L ontiner & 5L ontiner (without mrk) infinite supply of wter You n pour wter from one ontiner to nother

More information

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe

CSCI 104. Rafael Ferreira da Silva. Slides adapted from: Mark Redekopp and David Kempe CSCI 0 fel Ferreir d Silv rfsilv@isi.edu Slides dpted from: Mrk edekopp nd Dvid Kempe LOG STUCTUED MEGE TEES Series Summtion eview Let n = + + + + k $ = #%& #. Wht is n? n = k+ - Wht is log () + log ()

More information

COMP 423 lecture 11 Jan. 28, 2008

COMP 423 lecture 11 Jan. 28, 2008 COMP 423 lecture 11 Jn. 28, 2008 Up to now, we hve looked t how some symols in n lphet occur more frequently thn others nd how we cn sve its y using code such tht the codewords for more frequently occuring

More information

Lecture 13: Graphs I: Breadth First Search

Lecture 13: Graphs I: Breadth First Search Leture 13 Grphs I: BFS 6.006 Fll 2011 Leture 13: Grphs I: Bredth First Serh Leture Overview Applitions of Grph Serh Grph Representtions Bredth-First Serh Rell: Grph G = (V, E) V = set of verties (ritrry

More information

CMPUT101 Introduction to Computing - Summer 2002

CMPUT101 Introduction to Computing - Summer 2002 CMPUT Introdution to Computing - Summer 22 %XLOGLQJ&RPSXWHU&LUFXLWV Chpter 4.4 3XUSRVH We hve looked t so fr how to uild logi gtes from trnsistors. Next we will look t how to uild iruits from logi gtes,

More information

Problem Final Exam Set 2 Solutions

Problem Final Exam Set 2 Solutions CSE 5 5 Algoritms nd nd Progrms Prolem Finl Exm Set Solutions Jontn Turner Exm - //05 0/8/0. (5 points) Suppose you re implementing grp lgoritm tt uses ep s one of its primry dt strutures. Te lgoritm does

More information

2 Computing all Intersections of a Set of Segments Line Segment Intersection

2 Computing all Intersections of a Set of Segments Line Segment Intersection 15-451/651: Design & Anlysis of Algorithms Novemer 14, 2016 Lecture #21 Sweep-Line nd Segment Intersection lst chnged: Novemer 8, 2017 1 Preliminries The sweep-line prdigm is very powerful lgorithmic design

More information

Parallelization Optimization of System-Level Specification

Parallelization Optimization of System-Level Specification Prlleliztion Optimiztion of System-Level Speifition Luki i niel. Gjski enter for Emedded omputer Systems University of liforni Irvine, 92697, US {li, gjski} @es.ui.edu strt This pper introdues the prlleliztion

More information

Presentation Martin Randers

Presentation Martin Randers Presenttion Mrtin Rnders Outline Introduction Algorithms Implementtion nd experiments Memory consumption Summry Introduction Introduction Evolution of species cn e modelled in trees Trees consist of nodes

More information

Internet Routing. IP Packet Format. IP Fragmentation & Reassembly. Principles of Internet Routing. Computer Networks 9/29/2014.

Internet Routing. IP Packet Format. IP Fragmentation & Reassembly. Principles of Internet Routing. Computer Networks 9/29/2014. omputer Networks 9/29/2014 IP Pket Formt Internet Routing Ki Shen IP protool version numer heder length (words) for qulity of servie mx numer remining hops (deremented t eh router) upper lyer protool to

More information

Pattern Matching. Pattern Matching. Pattern Matching. Review of Regular Expressions

Pattern Matching. Pattern Matching. Pattern Matching. Review of Regular Expressions Pttern Mthing Pttern Mthing Some of these leture slides hve een dpted from: lgorithms in C, Roert Sedgewik. Gol. Generlize string serhing to inompletely speified ptterns. pplitions. Test if string or its

More information

Outline. Motivation Background ARCH. Experiment Additional usages for Input-Depth. Regular Expression Matching DPI over Compressed HTTP

Outline. Motivation Background ARCH. Experiment Additional usages for Input-Depth. Regular Expression Matching DPI over Compressed HTTP ARCH This work ws supported y: The Europen Reserh Counil, The Isreli Centers of Reserh Exellene, The Neptune Consortium, nd Ntionl Siene Foundtion wrd CNS-119748 Outline Motivtion Bkground Regulr Expression

More information

Lecture 8: Graph-theoretic problems (again)

Lecture 8: Graph-theoretic problems (again) COMP36111: Advned Algorithms I Leture 8: Grph-theoreti prolems (gin) In Prtt-Hrtmnn Room KB2.38: emil: iprtt@s.mn..uk 2017 18 Reding for this leture: Sipser: Chpter 7. A grph is pir G = (V, E), where V

More information

Type Checking. Roadmap (Where are we?) Last lecture Context-sensitive analysis. This lecture Type checking. Symbol tables

Type Checking. Roadmap (Where are we?) Last lecture Context-sensitive analysis. This lecture Type checking. Symbol tables Type Cheking Rodmp (Where re we?) Lst leture Contet-sensitie nlysis Motition Attriute grmmrs Ad ho Synt-direted trnsltion This leture Type heking Type systems Using synt direted trnsltion Symol tles Leil

More information

CS553 Lecture Introduction to Data-flow Analysis 1

CS553 Lecture Introduction to Data-flow Analysis 1 ! Ide Introdution to Dt-flow nlysis!lst Time! Implementing Mrk nd Sweep GC!Tody! Control flow grphs! Liveness nlysis! Register llotion CS553 Leture Introdution to Dt-flow Anlysis 1 Dt-flow Anlysis! Dt-flow

More information

Error Numbers of the Standard Function Block

Error Numbers of the Standard Function Block A.2.2 Numers of the Stndrd Funtion Blok evlution The result of the logi opertion RLO is set if n error ours while the stndrd funtion lok is eing proessed. This llows you to rnh to your own error evlution

More information

Distance vector protocol

Distance vector protocol istne vetor protool Irene Finohi finohi@i.unirom.it Routing Routing protool Gol: etermine goo pth (sequene of routers) thru network from soure to Grph strtion for routing lgorithms: grph noes re routers

More information

Orthogonal line segment intersection

Orthogonal line segment intersection Computtionl Geometry [csci 3250] Line segment intersection The prolem (wht) Computtionl Geometry [csci 3250] Orthogonl line segment intersection Applictions (why) Algorithms (how) A specil cse: Orthogonl

More information

Midterm Exam CSC October 2001

Midterm Exam CSC October 2001 Midterm Exm CSC 173 23 Otoer 2001 Diretions This exm hs 8 questions, severl of whih hve suprts. Eh question indites its point vlue. The totl is 100 points. Questions 5() nd 6() re optionl; they re not

More information

Algorithm Design (5) Text Search

Algorithm Design (5) Text Search Algorithm Design (5) Text Serch Tkshi Chikym School of Engineering The University of Tokyo Text Serch Find sustring tht mtches the given key string in text dt of lrge mount Key string: chr x[m] Text Dt:

More information

COSC 6374 Parallel Computation. Dense Matrix Operations

COSC 6374 Parallel Computation. Dense Matrix Operations COSC 6374 Prllel Computtion Dense Mtrix Opertions Edgr Griel Fll Edgr Griel Prllel Computtion Edgr Griel erminology Dense Mtrix: ll elements of the mtrix ontin relevnt vlues ypilly stored s 2-D rry, (e.g.

More information

Greedy Algorithm. Algorithm Fall Semester

Greedy Algorithm. Algorithm Fall Semester Greey Algorithm Algorithm 0 Fll Semester Optimiztion prolems An optimiztion prolem is one in whih you wnt to fin, not just solution, ut the est solution A greey lgorithm sometimes works well for optimiztion

More information

Computational geometry

Computational geometry Leture 23 Computtionl geometry Supplementl reding in CLRS: Chpter 33 exept 33.3 There re mny importnt prolems in whih the reltionships we wish to nlyze hve geometri struture. For exmple, omputtionl geometry

More information

Distributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems

Distributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems Distriuted Systems Priniples nd Prdigms Mrten vn Steen VU Amsterdm, Dept. Computer Siene steen@s.vu.nl Chpter 11: Distriuted File Systems Version: Deemer 10, 2012 2 / 14 Distriuted File Systems Distriuted

More information

INTEGRATED WORKFLOW ART DIRECTOR

INTEGRATED WORKFLOW ART DIRECTOR ART DIRECTOR Progrm Resoures INTEGRATED WORKFLOW PROGRAM PLANNING PHASE In this workflow phse proess, you ollorte with the Progrm Mnger, the Projet Mnger, nd the Art Speilist/ Imge Led to updte the resoures

More information

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Winter 2016 Solving Prolems y Serching CS 486/686: Introduction to Artificil Intelligence Winter 2016 1 Introduction Serch ws one of the first topics studied in AI - Newell nd Simon (1961) Generl Prolem Solver Centrl

More information

EXPONENTIAL & POWER GRAPHS

EXPONENTIAL & POWER GRAPHS Eponentil & Power Grphs EXPONENTIAL & POWER GRAPHS www.mthletics.com.u Eponentil EXPONENTIAL & Power & Grphs POWER GRAPHS These re grphs which result from equtions tht re not liner or qudrtic. The eponentil

More information

Calculus Differentiation

Calculus Differentiation //007 Clulus Differentition Jeffrey Seguritn person in rowot miles from the nerest point on strit shoreline wishes to reh house 6 miles frther down the shore. The person n row t rte of mi/hr nd wlk t rte

More information

CS453 INTRODUCTION TO DATAFLOW ANALYSIS

CS453 INTRODUCTION TO DATAFLOW ANALYSIS CS453 INTRODUCTION TO DATAFLOW ANALYSIS CS453 Leture Register llotion using liveness nlysis 1 Introdution to Dt-flow nlysis Lst Time Register llotion for expression trees nd lol nd prm vrs Tody Register

More information

COMMON FRACTIONS. or a / b = a b. , a is called the numerator, and b is called the denominator.

COMMON FRACTIONS. or a / b = a b. , a is called the numerator, and b is called the denominator. COMMON FRACTIONS BASIC DEFINITIONS * A frtion is n inite ivision. or / * In the frtion is lle the numertor n is lle the enomintor. * The whole is seprte into "" equl prts n we re onsiering "" of those

More information

ITEC2620 Introduction to Data Structures

ITEC2620 Introduction to Data Structures ITEC0 Introduction to Dt Structures Lecture 7 Queues, Priority Queues Queues I A queue is First-In, First-Out = FIFO uffer e.g. line-ups People enter from the ck of the line People re served (exit) from

More information

Shared Memory Architectures. Programming and Synchronization. Today s Outline. Page 1. Message passing review Cosmic Cube discussion

Shared Memory Architectures. Programming and Synchronization. Today s Outline. Page 1. Message passing review Cosmic Cube discussion Tody s Outline Arhitetures Progrmming nd Synhroniztion Disuss pper on Cosmi Cube (messge pssing) Messge pssing review Cosmi Cube disussion > Messge pssing mhine Shred memory model > Communition > Synhroniztion

More information

Minimal Memory Abstractions

Minimal Memory Abstractions Miniml Memory Astrtions (As implemented for BioWre Corp ) Nthn Sturtevnt University of Alert GAMES Group Ferury, 7 Tlk Overview Prt I: Building Astrtions Minimizing memory requirements Performnes mesures

More information

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits

Systems I. Logic Design I. Topics Digital logic Logic gates Simple combinational logic circuits Systems I Logic Design I Topics Digitl logic Logic gtes Simple comintionl logic circuits Simple C sttement.. C = + ; Wht pieces of hrdwre do you think you might need? Storge - for vlues,, C Computtion

More information

Lesson 4.4. Euler Circuits and Paths. Explore This

Lesson 4.4. Euler Circuits and Paths. Explore This Lesson 4.4 Euler Ciruits nd Pths Now tht you re fmilir with some of the onepts of grphs nd the wy grphs onvey onnetions nd reltionships, it s time to egin exploring how they n e used to model mny different

More information

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it.

6.3 Volumes. Just as area is always positive, so is volume and our attitudes towards finding it. 6.3 Volumes Just s re is lwys positive, so is volume nd our ttitudes towrds finding it. Let s review how to find the volume of regulr geometric prism, tht is, 3-dimensionl oject with two regulr fces seprted

More information

Can Pythagoras Swim?

Can Pythagoras Swim? Overview Ativity ID: 8939 Mth Conepts Mterils Students will investigte reltionships etween sides of right tringles to understnd the Pythgoren theorem nd then use it to solve prolems. Students will simplify

More information

Algorithms. Algorithms 3.2 BINARY SEARCH TREES. BSTs ordered operations iteration deletion (see book or videos) ROBERT SEDGEWICK KEVIN WAYNE

Algorithms. Algorithms 3.2 BINARY SEARCH TREES. BSTs ordered operations iteration deletion (see book or videos) ROBERT SEDGEWICK KEVIN WAYNE lgorithms OBT DGWIK KVIN WYN 3.2 BINY T lgorithms F O U T D I T I O N BTs ordered operations iteration deletion (see book or videos) OBT DGWIK KVIN WYN https://algs4.cs.princeton.edu Last updated on 10/9/18

More information

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers Wht do ll those bits men now? bits (...) Number Systems nd Arithmetic or Computers go to elementry school instruction R-formt I-formt... integer dt number text chrs... floting point signed unsigned single

More information

3.2 BINARY SEARCH TREES. BSTs ordered operations iteration deletion. Algorithms ROBERT SEDGEWICK KEVIN WAYNE.

3.2 BINARY SEARCH TREES. BSTs ordered operations iteration deletion. Algorithms ROBERT SEDGEWICK KEVIN WAYNE. 3.2 BINY T lgorithms BTs ordered operations iteration deletion OBT DGWIK KVIN WYN http://algs4.cs.princeton.edu Binary search trees Definition. BT is a binary tree in symmetric order. binary tree is either:

More information

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence

Solving Problems by Searching. CS 486/686: Introduction to Artificial Intelligence Solving Prolems y Serching CS 486/686: Introduction to Artificil Intelligence 1 Introduction Serch ws one of the first topics studied in AI - Newell nd Simon (1961) Generl Prolem Solver Centrl component

More information

Deletion The Two Child Case 10 Delete(5) Deletion The Two Child Case. Balanced BST. Finally

Deletion The Two Child Case 10 Delete(5) Deletion The Two Child Case. Balanced BST. Finally Deletion Te Two Cild Cse Delete() Deletion Te Two Cild Cse Ide: Replce te deleted node wit vlue gurnteed to e etween te two cild sutrees! Options: succ from rigt sutree: findmin(t.rigt) pred from left

More information

UTMC APPLICATION NOTE UT1553B BCRT TO INTERFACE PSEUDO-DUAL-PORT RAM ARCHITECTURE INTRODUCTION ARBITRATION DETAILS DESIGN SELECTIONS

UTMC APPLICATION NOTE UT1553B BCRT TO INTERFACE PSEUDO-DUAL-PORT RAM ARCHITECTURE INTRODUCTION ARBITRATION DETAILS DESIGN SELECTIONS UTMC APPLICATION NOTE UT1553B BCRT TO 80186 INTERFACE INTRODUCTION The UTMC UT1553B BCRT is monolithi CMOS integrte iruit tht provies omprehensive Bus Controller n Remote Terminl funtions for MIL-STD-

More information

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V)

V = set of vertices (vertex / node) E = set of edges (v, w) (v, w in V) Definitions G = (V, E) V = set of verties (vertex / noe) E = set of eges (v, w) (v, w in V) (v, w) orere => irete grph (igrph) (v, w) non-orere => unirete grph igrph: w is jent to v if there is n ege from

More information

FASTEST METHOD TO FIND ALTERNATIVE RE-ROUTE

FASTEST METHOD TO FIND ALTERNATIVE RE-ROUTE INTERNATIONAL JOURNAL OF RESEARCH IN COMPUTER APPLICATIONS AND ROBOTICS ISSN 2320-7345 FASTEST METHOD TO FIND ALTERNATIVE RE-ROUTE 1 M.JothiLkshmi, M.S., M.Phil. 2 C.Theeendr, M.S., M.Phil. 3 M.K.Pvithr,

More information

Containers: Queue and List

Containers: Queue and List Continers: Queue n List Queue A ontiner in whih insertion is one t one en (the til) n eletion is one t the other en (the he). Also lle FIFO (First-In, First-Out) Jori Cortell n Jori Petit Deprtment of

More information

McAfee Web Gateway

McAfee Web Gateway Relese Notes Revision C MAfee We Gtewy 7.6.2.11 Contents Aout this relese Enhnement Resolved issues Instlltion instrutions Known issues Additionl informtion Find produt doumenttion Aout this relese This

More information

Troubleshooting. Verify the Cisco Prime Collaboration Provisioning Installation (for Advanced or Standard Mode), page

Troubleshooting. Verify the Cisco Prime Collaboration Provisioning Installation (for Advanced or Standard Mode), page Trouleshooting This setion explins the following: Verify the Ciso Prime Collortion Provisioning Instlltion (for Advned or Stndrd Mode), pge 1 Upgrde the Ciso Prime Collortion Provisioning from Smll to

More information

Introduction to Algebra

Introduction to Algebra INTRODUCTORY ALGEBRA Mini-Leture 1.1 Introdution to Alger Evlute lgeri expressions y sustitution. Trnslte phrses to lgeri expressions. 1. Evlute the expressions when =, =, nd = 6. ) d) 5 10. Trnslte eh

More information

Class Overview. Database Design. Database Design Process. Database Design. Introduction to Data Management CSE 414

Class Overview. Database Design. Database Design Process. Database Design. Introduction to Data Management CSE 414 Introution to Dt Mngement CSE 44 Unit 6: Coneptul Design E/R Digrms Integrity Constrints BCNF Introution to Dt Mngement CSE 44 E/R Digrms ( letures) CSE 44 Autumn 08 Clss Overview Dtse Design Unit : Intro

More information

The Greedy Method. The Greedy Method

The Greedy Method. The Greedy Method Lists nd Itertors /8/26 Presenttion for use with the textook, Algorithm Design nd Applictions, y M. T. Goodrich nd R. Tmssi, Wiley, 25 The Greedy Method The Greedy Method The greedy method is generl lgorithm

More information

Duality in linear interval equations

Duality in linear interval equations Aville online t http://ijim.sriu..ir Int. J. Industril Mthemtis Vol. 1, No. 1 (2009) 41-45 Dulity in liner intervl equtions M. Movhedin, S. Slhshour, S. Hji Ghsemi, S. Khezerloo, M. Khezerloo, S. M. Khorsny

More information

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example:

box Boxes and Arrows 3 true 7.59 'X' An object is drawn as a box that contains its data members, for example: Boxes nd Arrows There re two kinds of vriles in Jv: those tht store primitive vlues nd those tht store references. Primitive vlues re vlues of type long, int, short, chr, yte, oolen, doule, nd flot. References

More information

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers?

Questions About Numbers. Number Systems and Arithmetic. Introduction to Binary Numbers. Negative Numbers? Questions About Numbers Number Systems nd Arithmetic or Computers go to elementry school How do you represent negtive numbers? frctions? relly lrge numbers? relly smll numbers? How do you do rithmetic?

More information

Distributed Systems Principles and Paradigms

Distributed Systems Principles and Paradigms Distriuted Systems Priniples nd Prdigms Christoph Dorn Distriuted Systems Group, Vienn University of Tehnology.dorn@infosys.tuwien..t http://www.infosys.tuwien..t/stff/dorn Slides dpted from Mrten vn Steen,

More information

Width and Bounding Box of Imprecise Points

Width and Bounding Box of Imprecise Points Width nd Bounding Box of Impreise Points Vhideh Keikh Mrten Löffler Ali Mohdes Zhed Rhmti Astrt In this pper we study the following prolem: we re given set L = {l 1,..., l n } of prllel line segments,

More information

Algorithms. Algorithms 3.2 BINARY SEARCH TREES. BSTs ordered operations deletion ROBERT SEDGEWICK KEVIN WAYNE.

Algorithms. Algorithms 3.2 BINARY SEARCH TREES. BSTs ordered operations deletion ROBERT SEDGEWICK KEVIN WAYNE. lgorithms OBT DGWIK KVIN WYN 3.2 BINY T lgorithms F O U T D I T I O N BTs ordered operations deletion OBT DGWIK KVIN WYN http://algs4.cs.princeton.edu 3.2 BINY T lgorithms BTs ordered operations deletion

More information

Hyperbolas. Definition of Hyperbola

Hyperbolas. Definition of Hyperbola CHAT Pre-Clculus Hyperols The third type of conic is clled hyperol. For n ellipse, the sum of the distnces from the foci nd point on the ellipse is fixed numer. For hyperol, the difference of the distnces

More information

CS 340, Fall 2016 Sep 29th Exam 1 Note: in all questions, the special symbol ɛ (epsilon) is used to indicate the empty string.

CS 340, Fall 2016 Sep 29th Exam 1 Note: in all questions, the special symbol ɛ (epsilon) is used to indicate the empty string. CS 340, Fll 2016 Sep 29th Exm 1 Nme: Note: in ll questions, the speil symol ɛ (epsilon) is used to indite the empty string. Question 1. [10 points] Speify regulr expression tht genertes the lnguge over

More information

LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION

LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION Overview LINX MATRIX SWITCHERS FIRMWARE UPDATE INSTRUCTIONS FIRMWARE VERSION 4.4.1.0 Due to the omplex nture of this updte, plese fmilirize yourself with these instrutions nd then ontt RGB Spetrum Tehnil

More information

10.2 Graph Terminology and Special Types of Graphs

10.2 Graph Terminology and Special Types of Graphs 10.2 Grph Terminology n Speil Types of Grphs Definition 1. Two verties u n v in n unirete grph G re lle jent (or neighors) in G iff u n v re enpoints of n ege e of G. Suh n ege e is lle inient with the

More information

Final Exam Review F 06 M 236 Be sure to look over all of your tests, as well as over the activities you did in the activity book

Final Exam Review F 06 M 236 Be sure to look over all of your tests, as well as over the activities you did in the activity book inl xm Review 06 M 236 e sure to loo over ll of your tests, s well s over the tivities you did in the tivity oo 1 1. ind the mesures of the numered ngles nd justify your wor. Line j is prllel to line.

More information

PARALLEL AND DISTRIBUTED COMPUTING

PARALLEL AND DISTRIBUTED COMPUTING PARALLEL AND DISTRIBUTED COMPUTING 2009/2010 1 st Semester Teste Jnury 9, 2010 Durtion: 2h00 - No extr mteril llowed. This includes notes, scrtch pper, clcultor, etc. - Give your nswers in the ville spce

More information

COMPUTER EDUCATION TECHNIQUES, INC. (WEBLOGIC_SVR_ADM ) SA:

COMPUTER EDUCATION TECHNIQUES, INC. (WEBLOGIC_SVR_ADM ) SA: In orer to lern whih questions hve een nswere orretly: 1. Print these pges. 2. Answer the questions. 3. Sen this ssessment with the nswers vi:. FAX to (212) 967-3498. Or. Mil the nswers to the following

More information

In the last lecture, we discussed how valid tokens may be specified by regular expressions.

In the last lecture, we discussed how valid tokens may be specified by regular expressions. LECTURE 5 Scnning SYNTAX ANALYSIS We know from our previous lectures tht the process of verifying the syntx of the progrm is performed in two stges: Scnning: Identifying nd verifying tokens in progrm.

More information

EECS 281: Homework #4 Due: Thursday, October 7, 2004

EECS 281: Homework #4 Due: Thursday, October 7, 2004 EECS 28: Homework #4 Due: Thursdy, October 7, 24 Nme: Emil:. Convert the 24-bit number x44243 to mime bse64: QUJD First, set is to brek 8-bit blocks into 6-bit blocks, nd then convert: x44243 b b 6 2 9

More information

10.5 Graphing Quadratic Functions

10.5 Graphing Quadratic Functions 0.5 Grphing Qudrtic Functions Now tht we cn solve qudrtic equtions, we wnt to lern how to grph the function ssocited with the qudrtic eqution. We cll this the qudrtic function. Grphs of Qudrtic Functions

More information

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers?

1.1. Interval Notation and Set Notation Essential Question When is it convenient to use set-builder notation to represent a set of numbers? 1.1 TEXAS ESSENTIAL KNOWLEDGE AND SKILLS Prepring for 2A.6.K, 2A.7.I Intervl Nottion nd Set Nottion Essentil Question When is it convenient to use set-uilder nottion to represent set of numers? A collection

More information

FEEDBACK: The standard error of a regression is not an unbiased estimator for the standard deviation of the error in a multiple regression model.

FEEDBACK: The standard error of a regression is not an unbiased estimator for the standard deviation of the error in a multiple regression model. Introutory Eonometris: A Moern Approh 6th Eition Woolrige Test Bnk Solutions Complete ownlo: https://testbnkre.om/ownlo/introutory-eonometris-moern-pproh-6th-eition-jeffreym-woolrige-test-bnk/ Solutions

More information

Enterprise Digital Signage Create a New Sign

Enterprise Digital Signage Create a New Sign Enterprise Digitl Signge Crete New Sign Intended Audiene: Content dministrtors of Enterprise Digitl Signge inluding stff with remote ess to sign.pitt.edu nd the Content Mnger softwre pplition for their

More information

Convex Hull Algorithms. Convex hull: basic facts

Convex Hull Algorithms. Convex hull: basic facts CG Leture D Conve Hull Algorithms Bsi fts Algorithms: Nïve, Gift wrpping, Grhm sn, Quik hull, Divide-nd-onquer Lower ound 3D Bsi fts Algorithms: Gift wrpping, Divide nd onquer, inrementl Conve hulls in

More information

Chapter 4 Fuzzy Graph and Relation

Chapter 4 Fuzzy Graph and Relation Chpter 4 Fuzzy Grph nd Reltion Grph nd Fuzzy Grph! Grph n G = (V, E) n V : Set of verties(node or element) n E : Set of edges An edge is pir (x, y) of verties in V.! Fuzzy Grph ~ n ( ~ G = V, E) n V :

More information

Tiling Triangular Meshes

Tiling Triangular Meshes Tiling Tringulr Meshes Ming-Yee Iu EPFL I&C 1 Introdution Astrt When modelling lrge grphis senes, rtists re not epeted to model minute nd repetitive fetures suh s grss or snd with individul piees of geometry

More information

AI Adjacent Fields. This slide deck courtesy of Dan Klein at UC Berkeley

AI Adjacent Fields. This slide deck courtesy of Dan Klein at UC Berkeley AI Adjcent Fields Philosophy: Logic, methods of resoning Mind s physicl system Foundtions of lerning, lnguge, rtionlity Mthemtics Forml representtion nd proof Algorithms, computtion, (un)decidility, (in)trctility

More information

Ma/CS 6b Class 1: Graph Recap

Ma/CS 6b Class 1: Graph Recap M/CS 6 Clss 1: Grph Recp By Adm Sheffer Course Detils Adm Sheffer. Office hour: Tuesdys 4pm. dmsh@cltech.edu TA: Victor Kstkin. Office hour: Tuesdys 7pm. 1:00 Mondy, Wednesdy, nd Fridy. http://www.mth.cltech.edu/~2014-15/2term/m006/

More information

From Dependencies to Evaluation Strategies

From Dependencies to Evaluation Strategies From Dependencies to Evlution Strtegies Possile strtegies: 1 let the user define the evlution order 2 utomtic strtegy sed on the dependencies: use locl dependencies to determine which ttriutes to compute

More information

Inter-domain Routing

Inter-domain Routing COMP 631: NETWORKED & DISTRIBUTED SYSTEMS Inter-domin Routing Jsleen Kur Fll 2016 1 Internet-sle Routing: Approhes DV nd link-stte protools do not sle to glol Internet How to mke routing slle? Exploit

More information

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012

Grade 7/8 Math Circles Geometric Arithmetic October 31, 2012 Fculty of Mthemtics Wterloo, Ontrio N2L 3G1 Grde 7/8 Mth Circles Geometric Arithmetic Octoer 31, 2012 Centre for Eduction in Mthemtics nd Computing Ancient Greece hs given irth to some of the most importnt

More information

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards

A Tautology Checker loosely related to Stålmarck s Algorithm by Martin Richards A Tutology Checker loosely relted to Stålmrck s Algorithm y Mrtin Richrds mr@cl.cm.c.uk http://www.cl.cm.c.uk/users/mr/ University Computer Lortory New Museum Site Pemroke Street Cmridge, CB2 3QG Mrtin

More information

Towards Unifying Advances in Twig Join Algorithms

Towards Unifying Advances in Twig Join Algorithms Pro. 21st Austrlsin Dtse Conferene (ADC 2010), Brisne, Austrli Towrds Unifying Advnes in Twig Join Algorithms Nils Grimsmo Truls A. Bjørklund Deprtment of Computer nd Informtion Siene Norwegin University

More information

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries

Tries. Yufei Tao KAIST. April 9, Y. Tao, April 9, 2013 Tries Tries Yufei To KAIST April 9, 2013 Y. To, April 9, 2013 Tries In this lecture, we will discuss the following exct mtching prolem on strings. Prolem Let S e set of strings, ech of which hs unique integer

More information

Outline. CS38 Introduction to Algorithms. Graphs. Graphs. Graphs. Graph traversals

Outline. CS38 Introduction to Algorithms. Graphs. Graphs. Graphs. Graph traversals Outline CS38 Introution to Algorithms Leture 2 April 3, 2014 grph trversls (BFS, DFS) onnetivity topologil sort strongly onnete omponents heps n hepsort greey lgorithms April 3, 2014 CS38 Leture 2 2 Grphs

More information

GENG2140 Modelling and Computer Analysis for Engineers

GENG2140 Modelling and Computer Analysis for Engineers GENG4 Moelling n Computer Anlysis or Engineers Letures 9 & : Gussin qurture Crete y Grn Romn Joles, PhD Shool o Mehnil Engineering, UWA GENG4 Content Deinition o Gussin qurture Computtion o weights n points

More information

What are suffix trees?

What are suffix trees? Suffix Trees 1 Wht re suffix trees? Allow lgorithm designers to store very lrge mount of informtion out strings while still keeping within liner spce Allow users to serch for new strings in the originl

More information

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers

What do all those bits mean now? Number Systems and Arithmetic. Introduction to Binary Numbers. Questions About Numbers Wht do ll those bits men now? bits (...) Number Systems nd Arithmetic or Computers go to elementry school instruction R-formt I-formt... integer dt number text chrs... floting point signed unsigned single

More information

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have

P(r)dr = probability of generating a random number in the interval dr near r. For this probability idea to make sense we must have Rndom Numers nd Monte Crlo Methods Rndom Numer Methods The integrtion methods discussed so fr ll re sed upon mking polynomil pproximtions to the integrnd. Another clss of numericl methods relies upon using

More information

Suffix trees, suffix arrays, BWT

Suffix trees, suffix arrays, BWT ALGORITHMES POUR LA BIO-INFORMATIQUE ET LA VISUALISATION COURS 3 Rluc Uricru Suffix trees, suffix rrys, BWT Bsed on: Suffix trees nd suffix rrys presenttion y Him Kpln Suffix trees course y Pco Gomez Liner-Time

More information

Introduction. Example

Introduction. Example OMS0 Introution isjoint sets n minimum spnning trees In this leture we will strt by isussing t struture use for mintining isjoint subsets of some bigger set. This hs number of pplitions, inluing to mintining

More information

Lexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay

Lexical Analysis. Amitabha Sanyal. (www.cse.iitb.ac.in/ as) Department of Computer Science and Engineering, Indian Institute of Technology, Bombay Lexicl Anlysis Amith Snyl (www.cse.iit.c.in/ s) Deprtment of Computer Science nd Engineering, Indin Institute of Technology, Bomy Septemer 27 College of Engineering, Pune Lexicl Anlysis: 2/6 Recp The input

More information

Lecture 14: Binary Search Trees (2)

Lecture 14: Binary Search Trees (2) cs2010: algorithms and data structures Lecture 14: Binary earch Trees (2) Vasileios Koutavas chool of omputer cience and tatistics Trinity ollege Dublin lgorithms OBT DGWIK KVIN WYN 3.2 BINY T lgorithms

More information

Graphing Conic Sections

Graphing Conic Sections Grphing Conic Sections Definition of Circle Set of ll points in plne tht re n equl distnce, clled the rdius, from fixed point in tht plne, clled the center. Grphing Circle (x h) 2 + (y k) 2 = r 2 where

More information