07 2015 档案

摘要:Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's tota... 阅读全文
posted @ 2015-07-07 19:43 OpenSoucre 阅读(997) 评论(0) 推荐(0) 编辑
摘要:Given an integer, write a function to determine if it is a power of two.题目意思: 给定一个整数,判断是否是2的幂解题思路: 如果一个整数是2的幂,则二进制最高位为1,减去1后则最高位变为0,后面全部是1,相与判读是否为零,... 阅读全文
posted @ 2015-07-07 16:21 OpenSoucre 阅读(171) 评论(0) 推荐(0) 编辑
摘要: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 o... 阅读全文
posted @ 2015-07-07 16:09 OpenSoucre 阅读(294) 评论(0) 推荐(0) 编辑

喜欢请打赏

扫描二维码打赏

了解更多

点击右上角即可分享
微信分享提示