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

Chapter 11. Graphs: Values with Relationships

The final data structure that we will examine is the Graph. Graphs are sets of objects with no specifically structured relationship, where each object can have links to one or many other objects in the collection. Objects in graphs are typically referred to as nodes, vertices, or points. Links, or the relationships between the objects, are referred to as edges, lines, or arcs. These links can be simple references or they can be objects with values of their own. More formally stated, graphs are a pair of sets (N, E), where N is the set of nodes and E is the set of edges in the collection.

One excellent example of graph applications would be visualizing the relationships between individuals in a social media database. In such a database, each person in the database represents one node, and each of their links to other people in their circle of acquaintances represents an edge. In such a circle of acquaintances, it would be perfectly reasonable to...