Binary Heap
The binary heap data structures is an array that can be viewed as a complete binary tree. Each node of the binary tree corresponds to an element of the array. The array is completely filled on all levels except possibly lowest.
ADT of Heap
Structure MAXHEAP is
MaxHeap Create(max_size) ::= create an empty heap that can hold a
maximum of max_size element.
Boolean HeapFull(heap,n) ::= if(n==max_size)return TRUE else
return FALSE
MaxHeap Insert(heap,item,n) ::= if(!HeapFull(heap,n) insert item into
heap and return the resulting heap
else return error.
Boolean HeapEmpty(heap,n) ::= if(n=0)return TRUE else return
FALSE
Element Delete(heap,n) ::= if(!HeapEmpty(heap,n)return one
instance of the largest element in the
heap and remove it from the heap
else return error.
فایل های دیگر این دسته
-
قیمت: 50٬000 تومان
پاورپوینت درس و کتاب برنامه سازی پیشرفته
-
قیمت: 50٬000 تومان
پاورپوینت اصول اساسی برنامه نويسی به زبان اسمبلی
-
قیمت: 24٬000 تومان
پاوربوینت به زبان لاتین با موضوع Introduction to heap and heap sort
-
قیمت: 52٬500 تومان
هوش مصنوعی
-
قیمت: 30٬000 تومان
نحوه شکل گيری RIPE و RIPE NCC
-
قیمت: 22٬000 تومان
امنیت شبكه و رمزگذاری و رمزگشایی
-
قیمت: 30٬000 تومان
پیدایش شبكه های کامپیوتری