摘要: 水题,递归。 直接给出代码。 阅读全文
posted @ 2018-06-01 19:22 Stoves 阅读(315) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers nums, write a method that returns the "pivot" index of this array. We define the pivot index as the index where the sum of 阅读全文
posted @ 2017-11-30 22:57 Stoves 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 题目大意是实现一个类来管理图书,类的每个实例包含图书的start跟end属性(start<= x < end),确保每个实例的两个属性没有重叠范围。 很容易想到二叉排序树,将每个实例看成一个结点,有三种情况: 1.新插入结点的start大于P结点的end,则将新插入结点插入到P结点的右子树,P = 阅读全文
posted @ 2017-11-30 21:18 Stoves 阅读(247) 评论(0) 推荐(0) 编辑