qq_26304333的博客

纯个人学习笔记记录

[c++基础] 序

目录 程序设计基本概念 预处理,const指针与sizeof 共有数据保护,静态成员,运算符重载 指针与引用 函数参数传递,数组 面向对象基础:类的四个基本函数 封装,继承和多态 模板与深/浅复制 内存,堆栈,资源,异常处理相关问题 四种类型转换和隐式类型转换 STL 智能指针

2017-04-18 16:31:29

阅读数 137

评论数 0

[leetcode]第18周作业

题目:120. Triangle Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below. ...

2018-01-07 10:32:35

阅读数 89

评论数 0

[leetcode]第17周作业

解: 我们可以把最大独立集问题规约到最大公共子图问题。对于任意的图 G(V, E),我们要求它的大小为b的独立集(即最大独立集), 我们可以令G1= G(V, E), G2= G(V, ),我们要求G 的最大独立集,可以转化为从G(V, E)中删除最少的顶点,使得余下的顶点 V' 相互独立,...

2017-12-30 11:47:35

阅读数 70

评论数 0

[leetcode] 第16周作业

题目:654. Maximum Binary TreeGiven an integer array with no duplicates. A maximum tree building on this array is defined as follow:1.The root is the ma...

2017-12-24 09:50:39

阅读数 74

评论数 0

[leetcode]第15周作业

题目: 547. Friend CirclesThere are N students in a class. Some of them are friends, while some are not. Their friendship is transitive in nature. For e...

2017-12-17 10:43:31

阅读数 72

评论数 0

[leetcode]第14周作业

题目:152. Maximum Product SubarrayFind the contiguous subarray within an array (containing at least one number) which has the largest product.For examp...

2017-12-09 15:33:20

阅读数 79

评论数 0

[leetcode]第13周作业

题目:525. Contiguous Array Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1.Example 1: Input: [0,...

2017-12-02 16:50:35

阅读数 51

评论数 0

[leetcode]第12周作业

问题:452. Minimum Number of Arrows to Burst BalloonsThere are a number of spherical balloons spread in two-dimensional space. For each balloon, provide...

2017-11-26 09:51:08

阅读数 63

评论数 0

[leetcode]第11周作业

题目:62. Unique Paths A robot is located at the top-left corner of a m x n grid (marked ‘Start’ in the diagram below).The robot can only move either do...

2017-11-19 14:25:53

阅读数 66

评论数 0

[leetcode]第十周作业

题目:< leetcode > 300. Longest Increasing SubsequenceGiven an unsorted array of integers, find the length of longest increasing subsequence.For e...

2017-11-11 09:38:39

阅读数 87

评论数 0

[leetcode]第九周作业

题目来源: < leetcode > 343 . Integer BreakGiven a positive integer n, break it into the sum of at least two positive integers and maximize the pr...

2017-11-04 22:53:48

阅读数 76

评论数 0

[leetcode]第八周作业

题目来源: < leetcode > 400. Nth Digit题目: Find the nth digit of the infinite integer sequence 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …Note: n is pos...

2017-10-30 11:46:14

阅读数 112

评论数 0

[leetcode]第七周作业

题目:134. Gas StationThere are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited g...

2017-10-22 11:15:43

阅读数 342

评论数 0

[leetcode] 第六周作业

题目一453.Minimum Moves to Equal Array ElementsGiven a non-empty integer array of size n, find the minimum number of moves required to make all array el...

2017-10-13 13:08:16

阅读数 74

评论数 0

[leetcode] 第五周作业

题目来源:8. String to Integer (atoi)题目:Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a ...

2017-10-09 20:44:09

阅读数 70

评论数 0

[leetcode] 第四周作业

题目来源: 53.Maximum Subarray题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, gi...

2017-09-27 10:40:12

阅读数 76

评论数 0

[leetcode] 第三周作业

题目来源: 215. Kth Largest Element in an Array题目: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sort...

2017-09-21 13:43:54

阅读数 323

评论数 0

[leetcode] 第一周作业

题目来源: 14. Longest Common Prefix题目 Write a function to find the longest common prefix string amongst an array of strings.分析: 比较直白的思路: 初始化公共前缀就是第一个字...

2017-09-21 13:33:41

阅读数 92

评论数 0

[leetcode] 第二周作业

题目来源:  53. Maximum Subarray 题目: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. ...

2017-09-18 09:40:47

阅读数 258

评论数 0

C++文件读写与getline()

1.ofstream 头文件:   文件不存在时会自动创建文件 当文件读写操作完成之后,我们必须将文件关闭以使文件重新变为可访问的。成员函数close(),它负责将缓存中的数据排放出来并关闭文件。这个函数一旦被调用,原先的流对象就可以被用来打开其它的文件了,这个文件也就可以重新被其它的进程所访问...

2017-07-01 11:02:48

阅读数 8461

评论数 1

提示
确定要删除当前文章?
取消 删除
关闭
关闭