- 博客(7)
- 收藏
- 关注
原创 二叉树的前序、中序、后序遍历—迭代方法
leetcode上的相关题目:前序:https://leetcode.com/problems/binary-tree-preorder-traversal/?tab=Description中序:https://leetcode.com/problems/binary-tree-inorder-traversal/?tab=Description后序:https://leetcode.
2017-02-25 11:35:46 9828
转载 C++拷贝构造函数详解
转自:http://blog.csdn.net/lwbeyond/article/details/6202256/一. 什么是拷贝构造函数首先对于普通类型的对象来说,它们之间的复制是很简单的,例如:[c-sharp] view plain copyint a = 100; int b = a; 而类对象与普通对象不同,类对象内部结构一般较为复杂
2017-02-23 19:27:52 443
原创 287. Find the Duplicate Number--binary search/快慢指针
Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate number must exist. Assume that there is only one duplicate number, fi
2017-02-18 20:55:27 540
转载 二维数组和指向指针的指针
二维数组和指向指针的指针一道面试题引发的问题,首先要知道[]的优先级高于*,题目:char **p,a[6][8]; 问p=a是否会导致程序在以后出现问题?为什么?直接用程序说明:#includevoid main(){ char **p,a[6][8]; p = a; printf("\n");}
2017-02-18 15:52:15 767
原创 378. Kth Smallest Element in a Sorted Matrix-binary search/heap
Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix.Note that it is the kth smallest element in the sorted order, not
2017-02-18 11:56:36 315
原创 494. Target Sum-回溯法、DP。
可以使用方法:回溯法、DP。相近的问题:Partition Equal Subset Sum、01背包(1)、01背包(2)。问题描述:You are given a list of non-negative integers, a1, a2, ..., an, and a target,S. Now you have 2 symbols + and -. For ea
2017-02-13 22:30:49 1962
转载 416. Partition Equal Subset Sum子数组和问题
相同子集和分割。与0-1背包相似:01背包(1)、01背包(2)。问题:Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in both subsets
2017-02-13 22:10:30 1206 2
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人