queue
betty1121
这个作者很懒,什么都没留下…
展开
-
67. Top K Frequent Words
Given a composition with different kinds of words, return a list of the top K most frequent words in the composition. Assumptions the composition is not null and is not guaranteed to be sorted K >= 1andK could be larger than the number of distinct ..原创 2021-07-10 07:48:51 · 126 阅读 · 0 评论 -
551. Maximum Number in a Queue
Given a queue of integers, find the maximum number in it. Assumption: the queue is not null or empty. Example: Queue contains 5,8,3,2,7 Answer: 8. class Solution { public int maxInQueue(Queue<Integer> queue) { int max = queue.poll();原创 2021-06-26 07:03:00 · 91 阅读 · 0 评论