自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

奋斗的伙计

每天进步一点点

  • 博客(12)
  • 资源 (4)
  • 问答 (1)
  • 收藏
  • 关注

原创 Best Time to Buy and Sell Stock

1. 题目:Best Time to Buy and Sell StockSay you have an array for which the ith element is the price of a given stock on day i.If you were only permitted to complete at most one transaction (ie

2015-06-29 22:33:24 533

原创 C语言知识总结

以下程序的输出结果#include void main(){ char * ptr="hello"; char str[]="hello"; printf("sizeof(pts) is %d\n", sizeof(ptr));//这里输出指针的大小 printf("sizeof(str) is %d\n", sizeof(str));//这里输出整个st

2015-06-29 09:07:06 684

原创 leetcode: Minimum Path Sum

Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along its path.Note: You can only move either down or right at

2015-06-26 19:34:47 358

转载 stl容器简单总结

STL标准容器类简介标准容器类说明顺序性容器vector从后面快速的插入与删除,直接访问任何元素deque从前面或后面快速的插入与删除,直接访问任何元素list双链表,从任何地方快速插入与删除关联容器set快速查找,不允许重复值multiset快速查找,允许重复值

2015-06-22 16:27:54 388

原创 最长连续公共子序列

在上一篇已经讲述过最长公共非连续子序列计算公式为:而对于最长公共连续子序列,实现的公式为:比较后,将数据的比较结果存放到二维数组中:实现代码为:时间复杂度和空间复杂度都是O(m*n)#include#include#include#includeusing namespace std;void longestComSubConstantSe

2015-06-21 17:20:37 1190

原创 最长公共子序列问题

最长公共子序列问题是使用动态规划的典型应用:解决此问题需要定义二维辅助数组:dp[m+1][n+1]其基本公式:最后通过回溯,找到其公共子序列:回溯方法如下:此图摘自:http://blog.csdn.net/yysdsyl/article/details/4226630实例程序如下:#include#include#include#inc

2015-06-21 16:22:32 455

转载 First Missing Positive

First Missing Positive:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm should run i

2015-06-20 09:06:33 319

原创 3sum、3Sum closet、 4sum

1. 3Sum【题目】Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Element

2015-06-18 14:03:11 798

原创 leetcode——Container With Most Water

Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Fin

2015-06-16 00:19:34 362

原创 leetcode——Largest Rectangle in Histogram

原题Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where

2015-06-14 16:49:52 627

原创 各种排序算法实现

1. 归并排序算法:非递归实现:void mergeSort(vector & nums, vector &tmpNums, int left, int right, int end)//right为右边一段数据的开始,同时也可以用来判断左边一段数据的结束,并且左边的数组长度总是大于或等于右边数组长度{ int idx_left=left; int idx_right=right;

2015-06-14 12:04:22 633

原创 STL控件的使用

1. list使用:数据结构的双链表一般来说对应stl中的list,并且list几乎提供了双链表操作的所有方法常见的list操作有(至少是我用到的):remove,push_back,#include#include using namespace std;struct node{ int key; int val;};void main(){ node

2015-06-14 09:50:38 567

hash表C语言实现

这是百度一位大牛写的hash结构

2016-07-26

c++游戏编程基础代码

本代码与c++经典游戏程序设计相配套的代码资料

2013-09-08

计算机考研专业课资料

好几年的试题及模拟题,不要错过啊,计算机专业统考必备的

2013-09-08

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

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