摘要:链接A:浅拷贝就是成员数据之间的一一赋值:把值赋给一一赋给要拷贝的值。但是可能会有这样的情况:对象还包含资源,这里的资源可以值堆资源,或者一个文件。。当值拷贝的时候,两个对象就有用共同的资源,同时对资源可以访问,这样就会出问题。深拷贝就是用来解决这样的问题的,它把资源也赋值一次,使对象拥有不同的资源
阅读全文
摘要:1/排序算法:冒泡排序bubble sort,插入排序 insertion sort,选择排序 selection sort,快速排序 quick sort,归并排序 merge sort;堆排序 heap sort 基于排序 桶排序bucket sort 一种特殊情况下的排序。 2/实现 1)冒泡
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:will show you all how to tackle various tree questions using iterative inorder traversal. First one is the standard iterative inorder traversal using
阅读全文