Graphs and Other Algorithms

In this chapter, we will discuss concepts related to the graphs. The concept of graphs comes from a branch of mathematics called graph theory. Graphs are used to solve a number of computing problems. Graphs are a non-linear data structure. This structure represents data by connecting a set of nodes or vertices along their edges. It is quite a different data structure compared to what we have looked at so far, and operations on graphs (for example, traversal) may be unconventional. We will be discussing many concepts related to graphs in this chapter. In addition, we will also be discussing priority queues and heaps later in the chapter.

By the end of this chapter, you should be able to do the following:

  • Understand what graphs are
  • Know the types of graphs and their constituents
  • Know how to represent a graph and traverse it
  • Get a fundamental idea of what priority queues are
  • Be able to implement a priority queue
  • Be able to determine the ith smallest element in a list
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset