自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

努力做技术宅

终于开始认真学代码了,开始做leetcode题目了

  • 博客(8)
  • 资源 (1)
  • 收藏
  • 关注

原创 Longest Substring Without Repeating Characters

Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the length of 1.Given "pwwkew", the answer is "wke", with the length of 3. Note t

2018-07-26 16:04:16 90

原创 Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...

2018-07-26 12:04:29 142

原创 ZigZag Conversion

题目The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)P A H NA P

2015-05-23 20:45:20 323

原创 house Robber

You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent house

2015-05-17 19:24:06 302

原创 C语言实现字符串中把空格换成%20问题

今天在笔试的时候遇到了一个题目,现在记录下来学习学习,题目就是把字符串中的空格换成“%20”,遇到这个问题会想到“%20”是一个字符还是3个字符,我当时就认为2个字符,'%','2','0'.实现这个代码的基本思想是:确定字符串数组的长度,和空格的个数,最后得到的字符串的长度为原字符串长度+2空格个数,从最后一个符号进行复制就可以了。#includevoid blankreplace(

2015-04-09 20:57:10 2186 2

原创 生成一个回文数

回文数就是它的倒序等于它本身,一个回文数的生成方法可以是数加上其倒序数,重复这个过程直到其为一个回文数,所以判断回文数的关键在于生成其倒序数。倒序数的程序代码为:int inverse(int n){int k=0;while(n){    k=k*10+n%10;n/=10;}return k;}生成回文数的过程:int ispal(int n

2015-04-09 20:55:13 2394

原创 快速排序问题

快速排序算法,看着容易,实际上很多细节需要注意,第一次进行排序之后,i,j之间的关系,递归的时候上下界的取值都是需要注意的,还有进行交换值的条件,否则在交换这一步也是很容易出错。代码实现:   #includevoid  quicksort(int *a,int m,int n){int i,j,k,temp,d;k=a[m];i=m;j=n;    if(m>

2015-04-09 09:32:01 588

原创 C语言中用函数实现整型数据位宽,如16,32位,不可以使用sizeof

在判断int位宽的时候,一般使用sizeof(int)实现,现在讨论一下,不用sizeof()来实现整数位宽。基本思想:可以利用地址之间的差值来确定整数位宽,代码实现为:#includevoid main(){int a[2];int b;b=(int(&a[1])-int(&a[0]))*8;printf("%d\t",b);}会存在这样的错误:b=(&a[1

2015-04-08 22:05:07 1974

元胞自动机

有关元胞自动机的算法的资料,有助于研究离散数据的研究。

2012-01-13

空空如也

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

TA关注的人

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