2017年9月4日

deep copy and shallow copy

摘要: 链接A:浅拷贝就是成员数据之间的一一赋值:把值赋给一一赋给要拷贝的值。但是可能会有这样的情况:对象还包含资源,这里的资源可以值堆资源,或者一个文件。。当值拷贝的时候,两个对象就有用共同的资源,同时对资源可以访问,这样就会出问题。深拷贝就是用来解决这样的问题的,它把资源也赋值一次,使对象拥有不同的资源 阅读全文

posted @ 2017-09-04 00:25 Shihu 阅读(190) 评论(0) 推荐(0) 编辑

2017年9月3日

Lecture--9 Sorting

摘要: 1/排序算法:冒泡排序bubble sort,插入排序 insertion sort,选择排序 selection sort,快速排序 quick sort,归并排序 merge sort;堆排序 heap sort 基于排序 桶排序bucket sort 一种特殊情况下的排序。 2/实现 1)冒泡 阅读全文

posted @ 2017-09-03 01:15 Shihu 阅读(190) 评论(0) 推荐(0) 编辑

2017年9月2日

leetcode--114. Flatten Binary Tree to Linked List

摘要: 1、问题描述 Given a binary tree, flatten it to a linked list in-place. For example,Given The flattened tree should look like: Hints: If you notice carefull 阅读全文

posted @ 2017-09-02 00:53 Shihu 阅读(165) 评论(0) 推荐(0) 编辑

leetcode--124. Binary Tree Maximum Path Sum

摘要: 1、问题描述 Given a binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node to any nod 阅读全文

posted @ 2017-09-02 00:04 Shihu 阅读(153) 评论(0) 推荐(0) 编辑

2017年9月1日

leetcode--103. Binary Tree Zigzag Level Order Traversal

摘要: 1、问题描述 Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next lev 阅读全文

posted @ 2017-09-01 01:09 Shihu 阅读(147) 评论(0) 推荐(0) 编辑

leetcode--Learn one iterative inorder traversal, apply it to multiple tree questions (Java Solution)

摘要: will show you all how to tackle various tree questions using iterative inorder traversal. First one is the standard iterative inorder traversal using 阅读全文

posted @ 2017-09-01 00:09 Shihu 阅读(163) 评论(0) 推荐(0) 编辑

2017年8月31日

leetcode--98. Validate Binary Search Tree

摘要: 1、问题描述 Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contai 阅读全文

posted @ 2017-08-31 23:19 Shihu 阅读(439) 评论(0) 推荐(0) 编辑

leetcode--47. Permutations II

摘要: 1、问题描述 Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following un 阅读全文

posted @ 2017-08-31 22:20 Shihu 阅读(212) 评论(0) 推荐(0) 编辑

leetcode-- 100. Same Tree

摘要: 1、问题描述 Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally iden 阅读全文

posted @ 2017-08-31 09:53 Shihu 阅读(134) 评论(0) 推荐(0) 编辑

leetcode--101. Symmetric Tree

摘要: 1、问题描述 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is 阅读全文

posted @ 2017-08-31 09:53 Shihu 阅读(148) 评论(0) 推荐(0) 编辑

导航