上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: 题目描述: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push element x onto stack. pop() -- 阅读全文
posted @ 2019-06-03 23:52 mingyu02 阅读(138) 评论(0) 推荐(0)
摘要: 题目描述: Write a program to find the node at which the intersection of two singly linked lists begins. For example, the following two linked lists: begin 阅读全文
posted @ 2019-06-02 22:39 mingyu02 阅读(117) 评论(0) 推荐(0)
摘要: 题目描述: Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times. You may assume th 阅读全文
posted @ 2019-06-02 02:28 mingyu02 阅读(106) 评论(0) 推荐(0)
摘要: 题目描述: Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. Could you implement both? 代码实 阅读全文
posted @ 2019-05-31 23:39 mingyu02 阅读(146) 评论(0) 推荐(0)
摘要: 题目描述: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. Ex 阅读全文
posted @ 2019-05-30 23:48 mingyu02 阅读(128) 评论(0) 推荐(0)
摘要: 题目描述: Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in t 阅读全文
posted @ 2019-05-29 23:47 mingyu02 阅读(119) 评论(0) 推荐(0)
摘要: 题目描述: Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ 阅读全文
posted @ 2019-05-29 00:12 mingyu02 阅读(114) 评论(0) 推荐(0)
摘要: 关于服务器的相关介绍:http://www.xcbkb.com/579.html 阅读全文
posted @ 2019-05-27 16:52 mingyu02 阅读(117) 评论(0) 推荐(0)
摘要: 题目描述: Given an integer, write a function to determine if it is a power of two. Example 1: Example 2: Example 3: 代码实现: 方法一:用递归的方法做: 方法二:用普通的while循环来做: 阅读全文
posted @ 2019-05-27 10:44 mingyu02 阅读(178) 评论(0) 推荐(0)
摘要: 题目描述: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wik 阅读全文
posted @ 2019-05-26 14:29 mingyu02 阅读(145) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页