Fork me on GitHub
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: /** * * @author gentleKay * Reverse digits of an integer. * Example1: x = 123, return 321 * Example2: x = -123, return -321 * click to show spoilers. 阅读全文
posted @ 2019-07-24 10:51 gentleKay 阅读(165) 评论(0) 推荐(0)
摘要: /** * @author gentleKay * Say you have an array for which the i th element is the price of a given stock on day i. * Design an algorithm to find the m 阅读全文
posted @ 2019-07-24 10:47 gentleKay 阅读(154) 评论(0) 推荐(0)
摘要: /** * @author gentleKay * 题目描述 * Given an array of integers, every element appears twice except for one. Find that single one. * Note: * Your algorith 阅读全文
posted @ 2019-07-23 14:53 gentleKay 阅读(193) 评论(0) 推荐(0)
摘要: /** * @author gentleKay * 题目描述 * Given a binary tree, find its maximum depth. * The maximum depth is the number of nodes along the longest path from t 阅读全文
posted @ 2019-07-23 14:50 gentleKay 阅读(172) 评论(0) 推荐(0)
摘要: 题目描述 Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are+,-,*,/. Each operand may be an integer or another 阅读全文
posted @ 2019-07-22 16:25 gentleKay 阅读(174) 评论(0) 推荐(0)
摘要: 题目描述 Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the neare 阅读全文
posted @ 2019-07-22 16:22 gentleKay 阅读(243) 评论(0) 推荐(0)
摘要: 题目描述 给定一个数组和滑动窗口的大小,找出所有滑动窗口里数值的最大值。例如,如果输入数组{2,3,4,2,6,2,5,1}及滑动窗口的大小3,那么一共存在6个滑动窗口,他们的最大值分别为{4,4,6,6,6,5}; 针对数组{2,3,4,2,6,2,5,1}的滑动窗口有以下6个: {[2,3,4] 阅读全文
posted @ 2019-07-19 11:42 gentleKay 阅读(241) 评论(0) 推荐(0)
摘要: 题目描述 如何得到一个数据流中的中位数?如果从数据流中读出奇数个数值,那么中位数就是所有数值排序之后位于中间的数值。如果从数据流中读出偶数个数值,那么中位数就是所有数值排序之后中间两个数的平均值。我们使用Insert()方法读取数据流,使用GetMedian()方法获取当前读取数据的中位数。 imp 阅读全文
posted @ 2019-07-19 11:40 gentleKay 阅读(269) 评论(0) 推荐(0)
摘要: 题目描述 给定一棵二叉搜索树,请找出其中的第k小的结点。例如, (5,3,7,2,4,6,8) 中,按结点数值大小顺序第三小结点的值为4。 import java.util.Stack; /** * * @author gentleKay * 题目描述 * 给定一棵二叉搜索树,请找出其中的第k小的结 阅读全文
posted @ 2019-07-18 17:18 gentleKay 阅读(166) 评论(0) 推荐(0)
摘要: 题目描述 请实现两个函数,分别用来序列化和反序列化二叉树 /** * * @author gentleKay * 题目描述 * 请实现两个函数,分别用来序列化和反序列化二叉树 * * 用例: * {8,6,10,5,7,9,11} * 对应输出应该为: * {8,6,10,5,7,9,11} * 你 阅读全文
posted @ 2019-07-18 17:17 gentleKay 阅读(129) 评论(0) 推荐(0)
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页