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

勘误-算法快速入门-示例 2:subsets #29

Open
lufflotneckar opened this issue Aug 4, 2020 · 1 comment
Open

勘误-算法快速入门-示例 2:subsets #29

lufflotneckar opened this issue Aug 4, 2020 · 1 comment

Comments

@lufflotneckar
Copy link

算法写错了,

  • 首先subsets()中调用backtrack()的次数少了.这是出错的根本原因;
  • 另外,backtrack()里面没有写退出递归的if条件;

导致得出的子集数量比正确答案的少.

@greyireland
Copy link
Owner

算法写错了,

  • 首先subsets()中调用backtrack()的次数少了.这是出错的根本原因;
  • 另外,backtrack()里面没有写退出递归的if条件;

导致得出的子集数量比正确答案的少.

这个是跑过的leetcode的

gitbook-com bot pushed a commit to zhangzz2015/algorithm-pattern that referenced this issue Jan 8, 2022
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

No branches or pull requests

2 participants