Can someone explain in simple terms to me what a directed acyclic graph is?

前端 未结 13 1225
暖寄归人
暖寄归人 2020-12-22 16:23

Can someone explain in simple terms to me what a directed acyclic graph is? I have looked on Wikipedia but it doesn\'t really make me see its use in programming.

13条回答
  •  不知归路
    2020-12-22 16:36

    Several answers have given examples of the use of graphs (e.g. network modeling) and you've asked "what does this have to do with programming?".

    The answer to that sub-question is that it doesn't have much of anything to do with programming. It has to do with problem solving.

    Just like linked-lists are data structures used for certain classes of problems, graphs are useful for representing certain relationships. Linked lists, trees, graphs, and other abstract structures only have a connection to programming in that you can implement them in code. They exist at a higher level of abstraction. It's not about programming, it's about applying data structures in the solution of problems.

提交回复
热议问题