What's the difference between the data structure Tree and Graph?

后端 未结 10 1811
醉话见心
醉话见心 2021-01-29 17:35

Academically speaking, what\'s the essential difference between the data structure Tree and Graph? And how about the tree based search and Graph based search?

10条回答
  •  清歌不尽
    2021-01-29 18:21

    Tree is special form of graph i.e. minimally connected graph and having only one path between any two vertices.

    In graph there can be more than one path i.e. graph can have uni-directional or bi-directional paths (edges) between nodes

    Also you can see more details: http://freefeast.info/difference-between/difference-between-trees-and-graphs-trees-vs-graphs/

提交回复
热议问题