使用Integer类型,您可以执行以下操作:
int lowest = Integer.MIN_VALUE;
Run Code Online (Sandbox Code Playgroud)
如果我使用泛型,我该怎么办?
K lowest = <...>;
Run Code Online (Sandbox Code Playgroud)
我需要这个来实现类似于PriorityQueue的东西.我可以访问我想要从队列中删除的节点,但它不是min.
1. I need to make it the min by decreasing the key of that node,
2. And then remove the min.
Run Code Online (Sandbox Code Playgroud)
我坚持第一步.我唯一能做的就是将节点的键设置为当前最小值.不确定它是否足够.