Graph Data Structure


Graphs are neither linear like lists nor hierarchical like trees. They connect one node to other nodes in any particular order to better represent affiliation between nodes. An "edge" is the connection between two nodes. Loosely, graphs with a lot of edges are "dense graphs", not many edges are "sparse graphs", and every node being connected to every other node means it's a "complete graph". Real life uses of graphs are GPS's, movie recommendation algorithms, and search engines.


An example of a (kind of) sparse graph: