We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
深度优先用栈,广度优先用队列 图的广度优先和深度优先遍历(BFS和DFS)
The text was updated successfully, but these errors were encountered:
二叉搜索树
Sorry, something went wrong.
leetcode 453 这题其实是道数学题,想了好久没想到,值得记录下: 已知:数列nums,初始和s0,长度n,最小的数为m 假设移动k步
今天刷LeetCode 207号题,发现毫无思路,应该是第一道“图”相关的题,记录一下。 根据《算法概论》中对有向无环图的讲解,判断一个有向图是否有环,有两个算法:
即找出该图的一个线性序列,使得需要事先完成的事件总排在之后才能完成的事件之前。如果能找到这样一个线性序列,则该图是一个有向无环图
遍历图中的所有点,从i点出发开始DFS,如果在DFS的不断深入过程中又回到了该点,则说明图中存在回路。
No branches or pull requests
深度优先用栈,广度优先用队列
图的广度优先和深度优先遍历(BFS和DFS)
The text was updated successfully, but these errors were encountered: