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

Enums


As discussed earlier, enums increase the level of abstraction in your application and allow the developer to focus on the meaning of the values rather than being concerned with how the values are stored in memory. This is because an enum type allows you to label specific integer numeric values with meaningful or easy to remember names.

Case study: the Metro line

Business problem: You work with an engineering team tasked with writing an application that keeps track of commuter trains along the Metro. One of the key business requirements is the ability to easily identify which station a train is currently located at or en route to. Each train station has a unique name, but the database tracks the stations by their ID values, such as 1100, 1200, 1300, and so on. Rather than track stations by name, which is both tedious and prone to change over time, your app will utilize the station IDs. However, the reason stations are labeled with names instead of IDs in the first place is to make it...