Book Image

Java 9 Data Structures and Algorithms

By : Debasish Ray Chawdhuri
Book Image

Java 9 Data Structures and Algorithms

By: Debasish Ray Chawdhuri

Overview of this book

Java 9 Data Structures and Algorithms covers classical, functional, and reactive data structures, giving you the ability to understand computational complexity, solve problems, and write efficient code. This book is based on the Zero Bug Bounce milestone of Java 9. We start off with the basics of algorithms and data structures, helping you understand the fundamentals and measure complexity. From here, we introduce you to concepts such as arrays, linked lists, as well as abstract data types such as stacks and queues. Next, we’ll take you through the basics of functional programming while making sure you get used to thinking recursively. We provide plenty of examples along the way to help you understand each concept. You will also get a clear picture of reactive programming, binary searches, sorting, search trees, undirected graphs, and a whole lot more!
Table of Contents (19 chapters)
Java 9 Data Structures and Algorithms
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Index

Chapter 10. Concepts of Graph

A graph is a generalization of a tree. In a tree, every node has one parent. In a graph, a node can have multiple parents. The most common way to think about a graph is as a set of vertices and edges. Vertices are like points and edges are like lines that connect the points. In the generic notion of a graph, there is no restriction on which vertices can be connected by edges. This allows graphs to model a versatile category of real-life concepts. The Internet, for example, is a graph where the vertices are the web pages and the edges the hyperlinks between the pages. A social networking site, such as Facebook, has a graph of profiles in which the vertices are the profiles and the edges the friendships between the profiles. Each software has a graph of dependencies, called a dependency graph, in which the vertices are the different software libraries used and the edges the dependencies between the software libraries. There is no end to examples of graphs. In...