Skip to content
New issue

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

1971.寻找图中是否存在路径:解决栈溢出问题 #2525

Closed
wants to merge 1 commit into from

Conversation

buaahjy
Copy link

@buaahjy buaahjy commented Apr 11, 2024

我在使用并查集模版时发现如果使用递归调用可能会发生栈溢出问题,可能是部分数据导致树的高度过高,递归深度超出范围
image
更改为迭代写法就通过了,所以感觉两种办法还是都要掌握的

…e union-find template to prevent stack overflow problems caused by recursive calls.
@buaahjy buaahjy changed the title Summary: Added an iterative implementation of the find function in th… 1971:寻找图中是否存在路径 Apr 11, 2024
@buaahjy buaahjy changed the title 1971:寻找图中是否存在路径 1971.寻找图中是否存在路径:解决栈溢出问题 Apr 11, 2024
@youngyangyang04
Copy link
Owner

你好,你提交的pr里 有其他无关文件,可以查看一下diff, 建议重新提交pr哈🌹

1 similar comment
@youngyangyang04
Copy link
Owner

你好,你提交的pr里 有其他无关文件,可以查看一下diff, 建议重新提交pr哈🌹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants