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
C# 版本中,如果 y - x 溢出会返回错误结果
// 初始化大顶堆(使用 lambda 表达式修改 Comparator 即可) PriorityQueue<int, int> maxHeap = new(Comparer<int>.Create((x, y) => y - x));
可以使用自带的 CompareTo 方法
PriorityQueue<int, int> maxHeap = new(Comparer<int>.Create((x, y) => y.CompareTo(x)));
或是更改比较器实现
PriorityQueue<int, int> maxHeap = new(Comparer<int>.Create((x, y) => { if (y < x) return -1; if (y > x) return 1; return 0; }));
The text was updated successfully, but these errors were encountered:
Hi @littletoxic , 感谢指出,会通过PR #1542 修改。
Sorry, something went wrong.
No branches or pull requests
C# 版本中,如果 y - x 溢出会返回错误结果
可以使用自带的 CompareTo 方法
或是更改比较器实现
The text was updated successfully, but these errors were encountered: