-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Part Heap : Code Translation into C++ (my_heap.cpp) #321
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
I fine-tuned the codes and comments. Please check it. Thanks for the PR! |
Got it. I will pay attention next time I contribute a PR 😄 |
Hello, I think you should add |
Great! Thank you for your advice. I will fix it later. |
Another suggestion: // 判空处理
if (empty()) {
cout << "Error:堆为空" << endl;
return;
} to deal with heap_empty error. // 判空处理
if (empty()) throw out_of_range("堆为空"); |
Thank you for your advice! I will fix it later! |
If this PR is related to coding or code translation, please fill out the checklist.
✅ I've tested the code and ensured the outputs are the same as the outputs of reference codes.
✅ I've checked the codes (formatting, comments, indentation, file header, etc) carefully.
✅ The code does not rely on a particular environment or IDE and can be executed on a standard system (Win, macOS, Ubuntu).
我已经完成了my_heap.cpp,实现效果如下: