heaps the word heap is used in couple of different contexts in computer science heap sometimes refers to an area of memory used for dynamic ( run-timememory allocation another meaningand the topic of this is data structure that is conceptually complete binary tree heaps are used in implementing priority queuesthe heapsort algorithmand some graph algorithms heaps are somewhat like binary search trees in that they maintain an ordering of the items within the tree howevera heap does not maintain complete ordering of its items this has some implications for how heap may be used goals by the end of this you should be able to answer the following questionswhat is heap and how is it usedwhat is the computational complexity of adding and deleting items from heapwould you use heap to look up items or notwhen would you use heapin the heapsort algorithmwhy is it advantageous to construct largest-on-top heap key ideas to understand heaps we'll start with definition largest-on-top heap is complete ordered tree such that every node is >all of its children (if it has anyan example will help illustrate this definition conceptuallya heap is tree that is full on all levels except possibly the lowest level which is filled in from left to right it takes the general shape shown in fig (cspringer international publishing switzerland lee and hubbarddata structures and algorithms with pythonundergraduate topics in computer sciencedoi -- this copy belongs to 'acha