摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2020-09-27 11:07 苗妙苗 阅读(137) 评论(0) 推荐(0)
摘要: Given two 1d vectors, implement an iterator to return their elements alternately. Example: Input: v1 = [1,2] v2 = [3,4,5,6] Output: [1,3,2,4,5,6] Expl 阅读全文
posted @ 2020-09-27 09:26 苗妙苗 阅读(145) 评论(0) 推荐(0)
摘要: Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it e 阅读全文
posted @ 2020-09-27 06:00 苗妙苗 阅读(92) 评论(0) 推荐(0)