Some Terminologies

Total Page:16

File Type:pdf, Size:1020Kb

Some Terminologies 1/9/2014 Some Terminologies Binary Trees, Binary Search Trees www.cs.ust.hk/~huamin/COMP17 1/bst. ppt • Child and parent – Every node except the root has one parent – A node can have an arbitrary number of children • Leaves – Nodes with no children • Sibling – nodes with same parent Trees Some Terminologies • Linear access time of linked lists is • Path prohibitive • Length – number of edges on the path – Does there exist any simple data structure • Depth of a node for which the running time of most – length of the unique path from the root to that node operations (search, insert, delete) is O(log – The depth of a tree is equal to the depth of the deepest leaf N)? • Height of a node – length of the longest path from that node to a leaf – all leaves are at height 0 – The height of a tree is equal to the height of the root • Ancestor and descendant – Proper ancestor and proper descendant Trees Example: UNIX Directory • A tree is a collection of nodes – The collection can be empty – (recursive definition) If not empty, a tree consists of a distinguished node r (the root ), and zero or more nonempty subtrees T1, T 2, ...., T k, each of whose roots are connected by a directed edge from r 1 1/9/2014 Binary Trees Preorder, Postorder and Inorder • A tree in which no node can have more than two children • Preorder traversal – node, left, right – prefix expression • ++a*bc*+*defg • The depth of an “average” binary tree is considerably smaller than N, eventhough in the worst case, the depth can be as large as N – 1. Example: Expression Trees Preorder, Postorder and Inorder • Postorder traversal – left, right, node – postfix expression • abc*+de*f+g*+ • Inorder traversal – left, node, right. • Leaves are operands (constants or variables) – infix expression • The other nodes (internal nodes) contain operators • a+b*c+d*e+f*g • Will not be a binary tree if some operators are not binary Tree traversal • Preorder • Used to print out the data in a tree in a certain order • Pre-order traversal – Print the data at the root – Recursively print out all data in the left subtree – Recursively print out all data in the right subtree 2 1/9/2014 compare: Implementation of a general tree • Postorder Preorder, Postorder and Inorder Binary Search Trees • Stores keys in the nodes in a way so that searching, insertion and deletion can be done efficiently. Binary search tree property – For every node X, all the keys in its left subtree are smaller than the key value in X, and all the keys in its right subtree are larger than the key value in X Binary Trees Binary Search Trees • Possible operations on the Binary Tree ADT – parent – left_child, right_child – sibling – root, etc • Implementation – Because a binary tree has at most two children, we can keep direct pointers to them A binary search tree Not a binary search tree 3 1/9/2014 Binary search trees Two binary search trees representing the same set: • Average depth of a node is O(log N); maximum depth of a node is O(N) Implementation Searching (Find) • Find X: return a pointer to the node that has key X, or NULL if there is no such node • Time complexity – O(height of the tree) Searching BST Inorder traversal of BST • If we are searching for 15, then we are done. • Print out all the keys in sorted order • If we are searching for a key < 15, then we should search in the left subtree. • If we are searching for a key > 15, then we should search in the right subtree. Inorder: 2, 3, 4, 6, 7, 9, 13, 15, 17, 18, 20 4 1/9/2014 findMin/ findMax delete • Return the node containing the smallest element in Three cases: the tree (1) the node is a leaf • Start at the root and go left as long as there is a left – Delete it immediately child. The stopping point is the smallest element (2) the node has one child – Adjust a pointer from the parent to bypass that node • Similarly for findMax • Time complexity = O(height of the tree) insert delete • Proceed down the tree as you would with a find (3) the node has 2 children • If X is found, do nothing (or update something) – replace the key of that node with the minimum element at the • Otherwise, insert X at the last spot on the path traversed right subtree – delete the minimum element • Has either no child or only right child because if it has a left child, that left child would be smaller and would have been chosen. So invoke case 1 or 2. • Time complexity = O(height of the tree) • Time complexity = O(height of the tree) delete • When we delete a node, we need to consider how we take care of the children of the deleted node. Priority Queues – Binary – This has to be done such that the property Heaps of the search tree is maintained. homes.cs.washington.edu/~anderson/ iucee/Slides_326.../ Heaps .ppt 30 5 1/9/2014 Applications of the Priority Queue Recall Queues • Select print jobs in order of decreasing length • FIFO: First-In, First-Out • Forward packets on routers in order of urgency • Some contexts where this seems right? • Select most frequent symbols for compression • Sort numbers, picking minimum first • Some contexts where some things should be allowed to skip ahead in the • Anything greedy line? 31 34 Queues that Allow Line Jumping Potential Implementations • Need a new ADT • Operations: Insert an Item, Remove the “Best” Item insert deleteMin Unsorted list (Array) O(1) O(n) Unsorted list (Linked-List) O(1) O(n) 6 2 Sorted list (Array) O(n) O(1)* 15 23 insert deleteMin 12 18 Sorted list (Linked-List) O(n) O(1) 45 3 7 32 35 Priority Queue ADT Recall From Lists, Queues, 1. PQueue data : collection of data with Stacks priority • Use an ADT that corresponds to your needs 2. PQueue operations • The right ADT is efficient, while an overly – insert general ADT provides functionality you – deleteMin aren’t using, but are paying for anyways 3. PQueue property : for two elements in the • Heaps provide O(log n) worst case for queue, x and y, if x has a lower priority both insert and deleteMin, O(1) average insert value than y, x will be deleted before y 33 36 6 1/9/2014 Brief interlude: Some Definitions: Binary Heap Properties A Perfect binary tree – A binary tree with all leaf nodes at the same depth. All 1. Structure Property internal nodes have 2 children. 2. Ordering Property height h h+1 11 2 – 1 nodes 2h – 1 non-leaves 5 21 2h leaves 2 9 16 25 1 3 7 10 13 19 22 30 37 40 Heap Structure Property Tree Review • A binary heap is a complete binary tree. Tree T Complete binary tree – binary tree that is A completely filled, with the possible exception root (T): of the bottom level, which is filled left to right. leaves (T): B C Examples : children (B) : parent (H) : D E F G siblings (E) : ancestors (F) : H I descendents (G) : subtree (C) : J K L M N 38 41 Representing Complete More Tree Terminology Binary Trees in an Array Tree T A depth (B) : 1 A From node i: height (G) : B C 2B 3 C 6 7 left child: 4D 5 E F G degree (B) : D E F G 89 10 11 12 right child: H I J K L parent: branching factor (T): H I implicit (array) implementation: J K L M N ABCDEFGHIJKL 0 1 2 3 4 5 6 7 8 9 10111213 39 42 7 1/9/2014 Why this approach to storage? Heap – Insert(val) Basic Idea: 1. Put val at “next” leaf position 2. Percolate up by repeatedly exchanging node until no longer needed 43 46 Heap Order Property Insert: percolate up 10 Heap order property : For every non-root 20 80 node X, the value in the parent of X is less than (or equal to) the value in X. 40 60 85 99 50 700 65 15 10 10 10 20 80 20 80 40 60 85 99 15 80 30 15 50 700 40 20 85 99 not a heap 50 700 65 60 44 47 Heap Operations Insert Code (optimized) • findMin: void insert(Object o) { int percolateUp(int hole, assert(!isFull()); Object val) { • insert(val): percolate up. while (hole > 1 && size++; val < Heap[hole/2]) • deleteMin: percolate down. newPos = Heap[hole] = Heap[hole/2]; percolateUp(size,o); hole /= 2; } 10 Heap[newPos] = o; return hole; } } 20 80 40 60 85 99 50 700 65 runtime: 45 (Code in book) 48 8 1/9/2014 Insert: 16, 32, 4, 69, 105, 43, 2 Heap – Deletemin 0 1 2 3 4 5 6 7 8 Basic Idea: 1. Remove root (that is always the min!) 2. Put “last” leaf node at root 3. Find smallest child of node 4. Swap node with its smallest child if needed. 5. Repeat steps 3 & 4 until no swaps needed. 49 52 DeleteMin: percolate down 10 20 15 Data Structures 40 60 85 99 50 700 65 Binary Heaps 15 20 65 40 60 85 99 50 700 50 53 DeleteMin Code (Optimized) Building a Heap Object deleteMin() { int percolateDown(int hole, assert(!isEmpty()); Object val) { while (2*hole <= size) { 12 5 11 3 10 6 9 4 8 1 7 2 returnVal = Heap[1]; left = 2*hole; size--; right = left + 1; newPos = if (right ≤ size && Heap[right] < Heap[left]) percolateDown(1, target = right; Heap[size+1]); else Heap[newPos] = target = left; Heap[size + 1]; if (Heap[target] < val) { return returnVal; Heap[hole] = Heap[target]; } hole = target; } else runtime: break; } (code in book) return hole; 51 54 } 9 1/9/2014 Buildheap pseudocode Building a Heap private void buildHeap() { • Adding the items one at a time is O(n for ( int i = currentSize/2; i > 0; i-- ) log n) in the worst case percolateDown( i ); } • I promised O(n) for today runtime: 55 58 BuildHeap: Floyd’s Method Working on Heaps • What are the two properties of a heap? 12 – Structure Property – Order Property 5 11 3 10 6 9 • How do we work on heaps? – Fix the structure 4 8 1 7 2 – Fix the order 56 59 BuildHeap: Floyd’s Method BuildHeap: Floyd’s Method 12 5 11 12 5 11 3 10 6 9 4 8 1 7 2 Add elements arbitrarily to form a complete tree.
Recommended publications
  • CMSC 341 Data Structure Asymptotic Analysis Review
    CMSC 341 Data Structure Asymptotic Analysis Review These questions will help test your understanding of the asymptotic analysis material discussed in class and in the text. These questions are only a study guide. Questions found here may be on your exam, although perhaps in a different format. Questions NOT found here may also be on your exam. 1. What is the purpose of asymptotic analysis? 2. Define “Big-Oh” using a formal, mathematical definition. 3. Let T1(x) = O(f(x)) and T2(x) = O(g(x)). Prove T1(x) + T2(x) = O (max(f(x), g(x))). 4. Let T(x) = O(cf(x)), where c is some positive constant. Prove T(x) = O(f(x)). 5. Let T1(x) = O(f(x)) and T2(x) = O(g(x)). Prove T1(x) * T2(x) = O(f(x) * g(x)) 6. Prove 2n+1 = O(2n). 7. Prove that if T(n) is a polynomial of degree x, then T(n) = O(nx). 8. Number these functions in ascending (slowest growing to fastest growing) Big-Oh order: Number Big-Oh O(n3) O(n2 lg n) O(1) O(lg0.1 n) O(n1.01) O(n2.01) O(2n) O(lg n) O(n) O(n lg n) O (n lg5 n) 1 9. Determine, for the typical algorithms that you use to perform calculations by hand, the running time to: a. Add two N-digit numbers b. Multiply two N-digit numbers 10. What is the asymptotic performance of each of the following? Select among: a. O(n) b.
    [Show full text]
  • Lecture 04 Linear Structures Sort
    Algorithmics (6EAP) MTAT.03.238 Linear structures, sorting, searching, etc Jaak Vilo 2018 Fall Jaak Vilo 1 Big-Oh notation classes Class Informal Intuition Analogy f(n) ∈ ο ( g(n) ) f is dominated by g Strictly below < f(n) ∈ O( g(n) ) Bounded from above Upper bound ≤ f(n) ∈ Θ( g(n) ) Bounded from “equal to” = above and below f(n) ∈ Ω( g(n) ) Bounded from below Lower bound ≥ f(n) ∈ ω( g(n) ) f dominates g Strictly above > Conclusions • Algorithm complexity deals with the behavior in the long-term – worst case -- typical – average case -- quite hard – best case -- bogus, cheating • In practice, long-term sometimes not necessary – E.g. for sorting 20 elements, you dont need fancy algorithms… Linear, sequential, ordered, list … Memory, disk, tape etc – is an ordered sequentially addressed media. Physical ordered list ~ array • Memory /address/ – Garbage collection • Files (character/byte list/lines in text file,…) • Disk – Disk fragmentation Linear data structures: Arrays • Array • Hashed array tree • Bidirectional map • Heightmap • Bit array • Lookup table • Bit field • Matrix • Bitboard • Parallel array • Bitmap • Sorted array • Circular buffer • Sparse array • Control table • Sparse matrix • Image • Iliffe vector • Dynamic array • Variable-length array • Gap buffer Linear data structures: Lists • Doubly linked list • Array list • Xor linked list • Linked list • Zipper • Self-organizing list • Doubly connected edge • Skip list list • Unrolled linked list • Difference list • VList Lists: Array 0 1 size MAX_SIZE-1 3 6 7 5 2 L = int[MAX_SIZE]
    [Show full text]
  • Advanced Data Structures
    Advanced Data Structures PETER BRASS City College of New York CAMBRIDGE UNIVERSITY PRESS Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, São Paulo Cambridge University Press The Edinburgh Building, Cambridge CB2 8RU, UK Published in the United States of America by Cambridge University Press, New York www.cambridge.org Information on this title: www.cambridge.org/9780521880374 © Peter Brass 2008 This publication is in copyright. Subject to statutory exception and to the provision of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. First published in print format 2008 ISBN-13 978-0-511-43685-7 eBook (EBL) ISBN-13 978-0-521-88037-4 hardback Cambridge University Press has no responsibility for the persistence or accuracy of urls for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate. Contents Preface page xi 1 Elementary Structures 1 1.1 Stack 1 1.2 Queue 8 1.3 Double-Ended Queue 16 1.4 Dynamical Allocation of Nodes 16 1.5 Shadow Copies of Array-Based Structures 18 2 Search Trees 23 2.1 Two Models of Search Trees 23 2.2 General Properties and Transformations 26 2.3 Height of a Search Tree 29 2.4 Basic Find, Insert, and Delete 31 2.5ReturningfromLeaftoRoot35 2.6 Dealing with Nonunique Keys 37 2.7 Queries for the Keys in an Interval 38 2.8 Building Optimal Search Trees 40 2.9 Converting Trees into Lists 47 2.10
    [Show full text]
  • Search Trees
    Lecture III Page 1 “Trees are the earth’s endless effort to speak to the listening heaven.” – Rabindranath Tagore, Fireflies, 1928 Alice was walking beside the White Knight in Looking Glass Land. ”You are sad.” the Knight said in an anxious tone: ”let me sing you a song to comfort you.” ”Is it very long?” Alice asked, for she had heard a good deal of poetry that day. ”It’s long.” said the Knight, ”but it’s very, very beautiful. Everybody that hears me sing it - either it brings tears to their eyes, or else -” ”Or else what?” said Alice, for the Knight had made a sudden pause. ”Or else it doesn’t, you know. The name of the song is called ’Haddocks’ Eyes.’” ”Oh, that’s the name of the song, is it?” Alice said, trying to feel interested. ”No, you don’t understand,” the Knight said, looking a little vexed. ”That’s what the name is called. The name really is ’The Aged, Aged Man.’” ”Then I ought to have said ’That’s what the song is called’?” Alice corrected herself. ”No you oughtn’t: that’s another thing. The song is called ’Ways and Means’ but that’s only what it’s called, you know!” ”Well, what is the song then?” said Alice, who was by this time completely bewildered. ”I was coming to that,” the Knight said. ”The song really is ’A-sitting On a Gate’: and the tune’s my own invention.” So saying, he stopped his horse and let the reins fall on its neck: then slowly beating time with one hand, and with a faint smile lighting up his gentle, foolish face, he began..
    [Show full text]
  • Functional Data Structures with Isabelle/HOL
    Functional Data Structures with Isabelle/HOL Tobias Nipkow Fakultät für Informatik Technische Universität München 2021-6-14 1 Part II Functional Data Structures 2 Chapter 6 Sorting 3 1 Correctness 2 Insertion Sort 3 Time 4 Merge Sort 4 1 Correctness 2 Insertion Sort 3 Time 4 Merge Sort 5 sorted :: ( 0a::linorder) list ) bool sorted [] = True sorted (x # ys) = ((8 y2set ys: x ≤ y) ^ sorted ys) 6 Correctness of sorting Specification of sort :: ( 0a::linorder) list ) 0a list: sorted (sort xs) Is that it? How about set (sort xs) = set xs Better: every x occurs as often in sort xs as in xs. More succinctly: mset (sort xs) = mset xs where mset :: 0a list ) 0a multiset 7 What are multisets? Sets with (possibly) repeated elements Some operations: f#g :: 0a multiset add mset :: 0a ) 0a multiset ) 0a multiset + :: 0a multiset ) 0a multiset ) 0a multiset mset :: 0a list ) 0a multiset set mset :: 0a multiset ) 0a set Import HOL−Library:Multiset 8 1 Correctness 2 Insertion Sort 3 Time 4 Merge Sort 9 HOL/Data_Structures/Sorting.thy Insertion Sort Correctness 10 1 Correctness 2 Insertion Sort 3 Time 4 Merge Sort 11 Principle: Count function calls For every function f :: τ 1 ) ::: ) τ n ) τ define a timing function Tf :: τ 1 ) ::: ) τ n ) nat: Translation of defining equations: E[[f p1 ::: pn = e]] = (Tf p1 ::: pn = T [[e]] + 1) Translation of expressions: T [[g e1 ::: ek]] = T [[e1]] + ::: + T [[ek]] + Tg e1 ::: ek All other operations (variable access, constants, constructors, primitive operations on bool and numbers) cost 1 time unit 12 Example: @ E[[ [] @ ys = ys ]] = (T@ [] ys = T [[ys]] + 1) = (T@ [] ys = 2) E[[ (x # xs)@ ys = x #(xs @ ys) ]] = (T@ (x # xs) ys = T [[x #(xs @ ys)]] + 1) = (T@ (x # xs) ys = T@ xs ys + 5) T [[x #(xs @ ys)]] = T [[x]] + T [[xs @ ys]] + T# x (xs @ ys) = 1 + (T [[xs]] + T [[ys]] + T@ xs ys) + 1 = 1 + (1 + 1 + T@ xs ys) + 1 13 if and case So far we model a call-by-value semantics Conditionals and case expressions are evaluated lazily.
    [Show full text]
  • Leftist Trees
    DEMO : Purchase from www.A-PDF.com to remove the watermark5 Leftist Trees 5.1 Introduction......................................... 5-1 5.2 Height-Biased Leftist Trees ....................... 5-2 Definition • InsertionintoaMaxHBLT• Deletion of Max Element from a Max HBLT • Melding Two Max HBLTs • Initialization • Deletion of Arbitrary Element from a Max HBLT Sartaj Sahni 5.3 Weight-Biased Leftist Trees....................... 5-8 University of Florida Definition • Max WBLT Operations 5.1 Introduction A single-ended priority queue (or simply, a priority queue) is a collection of elements in which each element has a priority. There are two varieties of priority queues—max and min. The primary operations supported by a max (min) priority queue are (a) find the element with maximum (minimum) priority, (b) insert an element, and (c) delete the element whose priority is maximum (minimum). However, many authors consider additional operations such as (d) delete an arbitrary element (assuming we have a pointer to the element), (e) change the priority of an arbitrary element (again assuming we have a pointer to this element), (f) meld two max (min) priority queues (i.e., combine two max (min) priority queues into one), and (g) initialize a priority queue with a nonzero number of elements. Several data structures: e.g., heaps (Chapter 3), leftist trees [2, 5], Fibonacci heaps [7] (Chapter 7), binomial heaps [1] (Chapter 7), skew heaps [11] (Chapter 6), and pairing heaps [6] (Chapter 7) have been proposed for the representation of a priority queue. The different data structures that have been proposed for the representation of a priority queue differ in terms of the performance guarantees they provide.
    [Show full text]
  • Leftist Heap: Is a Binary Tree with the Normal Heap Ordering Property, but the Tree Is Not Balanced. in Fact It Attempts to Be Very Unbalanced!
    Leftist heap: is a binary tree with the normal heap ordering property, but the tree is not balanced. In fact it attempts to be very unbalanced! Definition: the null path length npl(x) of node x is the length of the shortest path from x to a node without two children. The null path lengh of any node is 1 more than the minimum of the null path lengths of its children. (let npl(nil)=-1). Only the tree on the left is leftist. Null path lengths are shown in the nodes. Definition: the leftist heap property is that for every node x in the heap, the null path length of the left child is at least as large as that of the right child. This property biases the tree to get deep towards the left. It may generate very unbalanced trees, which facilitates merging! It also also means that the right path down a leftist heap is as short as any path in the heap. In fact, the right path in a leftist tree of N nodes contains at most lg(N+1) nodes. We perform all the work on this right path, which is guaranteed to be short. Merging on a leftist heap. (Notice that an insert can be considered as a merge of a one-node heap with a larger heap.) 1. (Magically and recursively) merge the heap with the larger root (6) with the right subheap (rooted at 8) of the heap with the smaller root, creating a leftist heap. Make this new heap the right child of the root (3) of h1.
    [Show full text]
  • Kd Trees What's the Goal for This Course? Data St
    Today’s Outline - kd trees CSE 326: Data Structures Too much light often blinds gentlemen of this sort, Seeing the forest for the trees They cannot see the forest for the trees. - Christoph Martin Wieland Hannah Tang and Brian Tjaden Summer Quarter 2002 What’s the goal for this course? Data Structures - what’s in a name? Shakespeare It is not possible for one to teach others, until one can first teach herself - Confucious • Stacks and Queues • Asymptotic analysis • Priority Queues • Sorting – Binary heap, Leftist heap, Skew heap, d - heap – Comparison based sorting, lower- • Trees bound on sorting, radix sorting – Binary search tree, AVL tree, Splay tree, B tree • World Wide Web • Hash Tables – Open and closed hashing, extendible, perfect, • Implement if you had to and universal hashing • Understand trade-offs between • Disjoint Sets various data structures/algorithms • Graphs • Know when to use and when not to – Topological sort, shortest path algorithms, Dijkstra’s algorithm, minimum spanning trees use (Prim’s algorithm and Kruskal’s algorithm) • Real world applications Range Query Range Query Example Y A range query is a search in a dictionary in which the exact key may not be entirely specified. Bellingham Seattle Spokane Range queries are the primary interface Tacoma Olympia with multi-D data structures. Pullman Yakima Walla Walla Remember Assignment #2? Give an algorithm that takes a binary search tree as input along with 2 keys, x and y, with xÃÃy, and ÃÃ ÃÃ prints all keys z in the tree such that x z y. X 1 Range Querying in 1-D
    [Show full text]
  • Binary Trees, Binary Search Trees
    Binary Trees, Binary Search Trees www.cs.ust.hk/~huamin/ COMP171/bst.ppt Trees • Linear access time of linked lists is prohibitive – Does there exist any simple data structure for which the running time of most operations (search, insert, delete) is O(log N)? Trees • A tree is a collection of nodes – The collection can be empty – (recursive definition) If not empty, a tree consists of a distinguished node r (the root), and zero or more nonempty subtrees T1, T2, ...., Tk, each of whose roots are connected by a directed edge from r Some Terminologies • Child and parent – Every node except the root has one parent – A node can have an arbitrary number of children • Leaves – Nodes with no children • Sibling – nodes with same parent Some Terminologies • Path • Length – number of edges on the path • Depth of a node – length of the unique path from the root to that node – The depth of a tree is equal to the depth of the deepest leaf • Height of a node – length of the longest path from that node to a leaf – all leaves are at height 0 – The height of a tree is equal to the height of the root • Ancestor and descendant – Proper ancestor and proper descendant Example: UNIX Directory Binary Trees • A tree in which no node can have more than two children • The depth of an “average” binary tree is considerably smaller than N, eventhough in the worst case, the depth can be as large as N – 1. Example: Expression Trees • Leaves are operands (constants or variables) • The other nodes (internal nodes) contain operators • Will not be a binary tree if some operators are not binary Tree traversal • Used to print out the data in a tree in a certain order • Pre-order traversal – Print the data at the root – Recursively print out all data in the left subtree – Recursively print out all data in the right subtree Preorder, Postorder and Inorder • Preorder traversal – node, left, right – prefix expression • ++a*bc*+*defg Preorder, Postorder and Inorder • Postorder traversal – left, right, node – postfix expression • abc*+de*f+g*+ • Inorder traversal – left, node, right.
    [Show full text]
  • Data Structures and Network Algorithms [Tarjan 1987-01-01].Pdf
    CBMS-NSF REGIONAL CONFERENCE SERIES IN APPLIED MATHEMATICS A series of lectures on topics of current research interest in applied mathematics under the direction of the Conference Board of the Mathematical Sciences, supported by the National Science Foundation and published by SIAM. GAKRHT BiRKiion , The Numerical Solution of Elliptic Equations D. V. LINDIY, Bayesian Statistics, A Review R S. VAR<;A. Functional Analysis and Approximation Theory in Numerical Analysis R R H:\II\DI:R, Some Limit Theorems in Statistics PXIKK K Bin I.VISLI -y. Weak Convergence of Measures: Applications in Probability .1. I.. LIONS. Some Aspects of the Optimal Control of Distributed Parameter Systems R(H;I:R PI-NROSI-:. Tecltniques of Differentia/ Topology in Relativity Hi.KM \N C'ui KNOI r. Sequential Analysis and Optimal Design .1. DI'KHIN. Distribution Theory for Tests Based on the Sample Distribution Function Soi I. Ri BINO\\, Mathematical Problems in the Biological Sciences P. D. L\x. Hyperbolic Systems of Conservation Laws and the Mathematical Theory of Shock Waves I. .1. Soioi.NUiiRci. Cardinal Spline Interpolation \\.\\ SiMii.R. The Theory of Best Approximation and Functional Analysis WI-.KNI R C. RHHINBOLDT, Methods of Solving Systems of Nonlinear Equations HANS I-'. WHINBKRQKR, Variational Methods for Eigenvalue Approximation R. TYRRM.I. ROCKAI-KLI.AK, Conjugate Dtialitv and Optimization SIR JAMKS LIGHTHILL, Mathematical Biofhtiddynamics GI-.RAKD SAI.ION, Theory of Indexing C \ rnLi-:i;.N S. MORAWKTX, Notes on Time Decay and Scattering for Some Hyperbolic Problems F. Hoi'i'hNSTKAm, Mathematical Theories of Populations: Demographics, Genetics and Epidemics RK HARD ASKF;Y.
    [Show full text]
  • Problem 1: “ Buzzin' in 3-Space” (36 Pts) Problem 2:“Ding Dong Bell
    Name CMSC 420 Data Structures Sample Midterm Given Spring, 2000 Dr. Michelle Hugue Problem 1: “ Buzzin’ in 3-Space” (36 pts) (6) 1.1 Build a K-D tree from the set of points below using the following assumptions: • the points are inserted in alphabetical order by label • the x coordinate is the first key discriminator • if the key discriminators are equal, go left A: (0,7,1 ) B: (1,2,8) C: ( 6, 5,1) D: (4,0,6) E: (3,1,4) F: ( 4, 0,9) G: (9,9,10 ) H: (3,4,7) I: ( 1, 1,1) (6) 1.2 Explain an algorithm to identify all points within a k-d tree that are within a given distance, r, of the point (x0,y0,z0). Your algorithm should be efficient, in the sense that it should not always need to examine all the nodes. (6) 1.3 The three-dimensional analog of a point-quadtree is a point-octree. Give an expression for the minimum number of nodes in a left complete point-octree with levels numbered 0, 1,...,k. (6) 1.4 Explain the difficulties, if any, with deletion of nodes in a point octree. Hint: One way that deletions are performed is by re-inserting any nodes in the subtrees of the deleted one. Why? (6) 1.5 Describe a set of attributes of the data set, or any other reason, that would cause you to choose a k-d tree over a point-octree, and explain your reasoning. Or, if you can’t imagine ever choosing the k-d tree instead of the point-octree, explain why.
    [Show full text]
  • Priority Queues and Heaps
    CMSC 206 Binary Heaps Priority Queues Priority Queues n Priority: some property of an object that allows it to be prioritized with respect to other objects of the same type n Min Priority Queue: homogeneous collection of Comparables with the following operations (duplicates are allowed). Smaller value means higher priority. q void insert (Comparable x) q void deleteMin( ) q Comparable findMin( ) q Construct from a set of initial values q boolean isEmpty( ) q boolean isFull( ) q void makeEmpty( ) Priority Queue Applications n Printer management: q The shorter document on the printer queue, the higher its priority. n Jobs queue within an operating system: q Users’ tasks are given priorities. System has high priority. n Simulations q The time an event “happens” is its priority. n Sorting (heap sort) q An elements “value” is its priority. Possible Implementations n Use a sorted list. Sorted by priority upon insertion. q findMin( ) --> list.front( ) q insert( ) --> list.insert( ) q deleteMin( ) --> list.erase( list.begin( ) ) n Use ordinary BST q findMin( ) --> tree.findMin( ) q insert( ) --> tree.insert( ) q deleteMin( ) --> tree.delete( tree.findMin( ) ) n Use balanced BST q guaranteed O(lg n) for Red-Black Min Binary Heap n A min binary heap is a complete binary tree with the further property that at every node neither child is smaller than the value in that node (or equivalently, both children are at least as large as that node). n This property is called a partial ordering. n As a result of this partial ordering, every path from the root to a leaf visits nodes in a non- decreasing order.
    [Show full text]