2017年12月13日

container-with-most-water

摘要: 题目: Given n non-negative integers a1 , a2 , ..., an , where each represents a point at coordinate (i, ai ). n vertical lines are drawn such that the t 阅读全文

posted @ 2017-12-13 22:05 夜的第八章 阅读(140) 评论(0) 推荐(0) 编辑

查找链表中是否有环linked-list-cycle

摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 不使用额外空间:这里没有实例化一个对象,只是引用对象,所以不会开辟新内存空间 用 阅读全文

posted @ 2017-12-13 20:56 夜的第八章 阅读(133) 评论(0) 推荐(0) 编辑

reverse-integer

摘要: 题目: Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you thought about this? Here are some good questi 阅读全文

posted @ 2017-12-13 20:38 夜的第八章 阅读(127) 评论(0) 推荐(0) 编辑

AVL树之 Java的实现

摘要: AVL树的介绍 AVL树是高度平衡的而二叉树。它的特点是:AVL树中任何节点的两个子树的高度最大差别为1。 上面的两张图片,左边的是AVL树,它的任何节点的两个子树的高度差别都<=1;而右边的不是AVL树,因为7的两颗子树的高度相差为2(以2为根节点的树的高度是3,而以8为根节点的树的高度是1)。 阅读全文

posted @ 2017-12-13 17:00 夜的第八章 阅读(753) 评论(0) 推荐(0) 编辑

导航