Analysis of Algorithms
Analysis of Algorithms CS 5633
Popular in Course
Popular in ComputerScienence
verified elite notetaker
This 3 page Class Notes was uploaded by Mireya Heidenreich on Thursday October 29, 2015. The Class Notes belongs to CS 5633 at University of Texas at San Antonio taught by Staff in Fall. Since its upload, it has received 16 views. For similar materials see /class/231391/cs-5633-university-of-texas-at-san-antonio in ComputerScienence at University of Texas at San Antonio.
Reviews for Analysis of Algorithms
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 10/29/15
Dynamic Sets Dynamic sets are data structures that support some or all of the following operations SEARCHS 16 Return 1 with keg51 k INSERTS 51 Insert 1 into S DELETES 1 Delete 1 from S MINIMUMS Return 1 with minimum keg51 MAXIMUMS Return 1 with maximum keg51 SUCCESSORS L Return 3 with next highest key PREDECESSORS L Return 3 with next lowest key S is a set 1 and y are elements 16 is a key NIL is returned if operation can t be performed Simple Dynamic Set Data Structures Dynamic Set Stack Queue Linked List SEARCH LIST SEARCH INSERT PUSH ENQUEUE LIST INSERT DELETE POP DEQUEUE LIST DELETE All stack and queue operations are 91 LIST INSERT is 91 for unsorted lists 0n for sorted lists LIST DELETE is 91 for doubly linked lists 0n for singly linked lists Average Case Analysis of LIST SEARCH LISTSEARCHL k x H headL while x y NIL and kegM y k do x H nex x return x LIST SEARCH is n on average Suppose there are n elements Each element is equally likely to be searched Search for the ith element uses 239 comparisons The expected value is the following summation 21 There are n elements to search for ln Prob for 2th element is 171 2 239 comparisons needed to nd ith element mi 1n n1 z z i E n z i 2 The result is Allocating and Freeing Objects ALLOCATE OBJECTO if free NIL then return NIL x 9 free free 9 next T66 return x FREE OBJECTJC nex x 9 free free 9 x Binary Tree Representation parent key data left right root
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'