摘要:
Find the Duplicate Number: Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one du 阅读全文
摘要:
set集合容器使用一种红黑树(Red-Black Tree)的平衡二叉检索树的数据结构,来组织泛华的元素数据。元素数据的检索,使用二叉检索树得中序遍历算法,检索的效率高于vector、deque和list等容器。 红黑树的节点结构: color left parent right data (颜色 阅读全文
摘要:
Counting Bits Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary repres 阅读全文
摘要:
Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文