Book Image

Everyday data structures

By : William Smith
Book Image

Everyday data structures

By: William Smith

Overview of this book

Explore a new world of data structures and their applications easily with this data structures book. Written by software expert William Smith, you?ll learn how to master basic and advanced data structure concepts. ? Fully understand data structures using Java, C and other common languages ? Work through practical examples and learn real-world applications ? Get to grips with data structure problem solving using case studies
Table of Contents (20 chapters)
Everyday Data Structures
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
1
Data Types: Foundational Structures

Common applications


Heap data structures are actually quite common, although you may not always realize you are working with one. Here are some of the most common applications for the heap data structure:

  • Selection algorithms: A selection algorithm is used to determine the kth smallest or largest element in a collection, or the median valued object of a collection. In a typically collection, this operation costs O(n). However, in an ordered heap implemented with an array finding the kth element is an O(1) operation because we can find the element by simply examining the k index in the array.

  • Priority queue: Priority queues are an abstract data structure similar to standard queues except that the nodes contain an additional value representing the priority of that object in relation to others in the collection. Due to the natural sorting of the heap data structure, priority queues are often implemented using the heap.