上一页 1 ··· 12 13 14 15 16

2017年8月27日

leecode-39. Combination Sum

摘要: 1、问题描述: Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbe 阅读全文

posted @ 2017-08-27 13:34 Shihu 阅读(177) 评论(0) 推荐(0) 编辑

课堂笔记

摘要: 1.拓扑排序 阅读全文

posted @ 2017-08-27 11:31 Shihu 阅读(121) 评论(0) 推荐(0) 编辑

2017年8月26日

linkedlist--lecture-4

摘要: 1、链表数据结构 内存利用率高;动态分配 2、链表类定义 单向链表节点 public calss ListNode { int val =0; ListNode next = null; public void Node(int val_) { this.val = val_; this.next 阅读全文

posted @ 2017-08-26 21:00 Shihu 阅读(394) 评论(0) 推荐(0) 编辑

lecture-7 递归

摘要: 1、例题--排列 Permutation Given a collection of distinct numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2 阅读全文

posted @ 2017-08-26 21:00 Shihu 阅读(195) 评论(0) 推荐(0) 编辑

[LeetCode]169. Majority Element

摘要: 1.Description 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 a 阅读全文

posted @ 2017-08-26 20:59 Shihu 阅读(278) 评论(0) 推荐(0) 编辑

234. Palindrome Linked List

摘要: 旋转链表函数 public ListNode reverse(ListNode head) { ListNode prev = null; while (head != null) { ListNode next = head.next; head.next = prev; prev = head; 阅读全文

posted @ 2017-08-26 20:58 Shihu 阅读(305) 评论(0) 推荐(0) 编辑

2017年8月10日

[LeetCode]189. Rotate Array

摘要: 1、题目描述 Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3, 阅读全文

posted @ 2017-08-10 21:34 Shihu 阅读(140) 评论(0) 推荐(0) 编辑

2017年8月2日

红黑树

摘要: 1、红黑树的限制条件 1)红黑树的节点是有颜色的,红色或者黑色 2)根节点是黑色的 3)每个叶子节点(叶节点即指树尾端NIL指针或NULL节点)是黑色的 4)如果一个节点是红色的,那么它的两个子节点都是黑色的;推论,不存在两个红色节点是相邻的。 5)从一个节点开始到每个叶子节点的简单路径上面的黑色节 阅读全文

posted @ 2017-08-02 20:40 Shihu 阅读(160) 评论(0) 推荐(0) 编辑

二叉排序树

摘要: 1、二叉排序树删除节点P 假设节点P是节点F的左子树 1)节点P无子节点 直接删除,其他节点不动。 2)节点P只有左子节点Pl或者右子节点Pr 删除P,将Pl或者Pr挂载为F节点的左子树。如果P为F的右子树,则挂载为F的右子树。这样也不会破坏二叉排序树的特性(指排序的变化)。 3)节点P既有左子树P 阅读全文

posted @ 2017-08-02 20:33 Shihu 阅读(182) 评论(0) 推荐(0) 编辑

上一页 1 ··· 12 13 14 15 16

导航