用DFS算法在Python中运行的DFS算法计算该程序的CopMplexity
我已经基于图数据结构列表实现实现了Python程序,并使用了用于遍历顶点的DFS算法。以下是我程序中每种方法的时间复杂性。
O(1) + O(1) + O(n) +(o(n) * o(v + e))
v为顶点,e是边缘。
如果有人可以帮助我计算上述内容,那将是我的整个程序时间复杂性。谢谢!
I have implemented a python program based on Graph data structure list implementation and used DFS algorithm for traversing vertex. Below is the time complexity of each method in my program.
O(1) + O(1) + O(n) + ( O(n) * O(V + E) )
V is Vertex and E is Edge.
If someone can help me calculate the above, that will be my whole program time complexity. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论