自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(16)
  • 资源 (1)
  • 收藏
  • 关注

原创 vim编辑器小结

1、编辑和保存文件 vim分为插入和命令两种模式。在插入模式下可以输入字符,命令模式下则执行除了输入字符之外的所有操作,包括保存、搜索、移动光标等。启动vim时自动处于命令模式,按I(i)键可以进入插入模式,这个命令用于在当前光标所在处插入字符。vim会在左下角提示用户此时所处的模式。 按Esc键回到命令模式,此时左下角的"-- 插入 --"提示消失,告诉用户正处于命令模式下。使用

2016-11-24 14:19:25 431

原创 Invert Binary Tree

Invert a binary tree. 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1递归算法: 1、交换根节点的左右子树。 2、对左右子树分别执行递归交换 。代码如下:/** * Definition for a binary tree no

2016-07-20 08:28:42 394

原创 Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two

2016-07-19 21:27:01 279

原创 Multiply Strings

Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-negative. Converting the input string to integer is N

2016-07-15 17:50:14 273

原创 Basic Calculator II

Implement a basic calculator to evaluate a simple expression string.The expression string contains only non-negative integers, +, -, *, / operators and empty spaces . The integer division should trunca

2016-07-15 09:10:19 318

原创 Valid Palindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example, “A man, a plan, a canal: Panama” is a palindrome. “race a car” is not a palin

2016-07-13 20:58:07 227

原创 Count and Say

The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, …1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off as “one 2, the

2016-07-13 17:18:00 209

原创 String to Integer (atoi)

Implement atoi to convert a string to an integer.说明:实现的atoi函数需要满足以下特征 1、忽略字符串第一个非空格字符前的所有空格(whitespace),第一个非空格字符可以是正负号,后面接纯数字,atoi函数将这些纯数字转换为整型并返回; 3、如果字符串中第一个非空格字符不是一个数字,字符串为空或仅由空格组成,则不对之进行转换; 3、在数

2016-07-13 08:16:57 384

原创 Reverse Vowels of a String

Write a function that takes a string as input and reverse only the vowels of a string.Example 1: Given s = “hello”, return “holle”.Example 2: Given s = “leetcode”, return “leotcede”.代码://遍历字符串,temp数组

2016-07-12 22:26:05 218

原创 远程下载嵌入式WEB服务器里的文件

因项目需要,用S3C2440和GoAhead构建嵌入式WEB服务器。嵌入式设备实时存储数据到SD卡,需要远程下载SD卡存储的数据。编写网页放在嵌入式设备里,在浏览器输入嵌入式设备的IP可以访问网页。 之前考虑过用链接来下载文件,可是没有成功,后来发现URL写的不对。URL的一般形式为: <协议>://<主机>:<端口>/<路径>。其中,<协议>通常为http协议;<主机>为该主机的域名;<端口>为

2016-06-26 22:13:34 481

原创 HexToFloat和HexToDouble

要明白如何将十六进制转换为float或double,需要了解浮点数的二进制存储和转换方式。float和double在存储方式上都遵从IEEE的规范,且float遵从IEEE R32.24,而double遵从R64.53。具体转换规则可以参考http://www.cnblogs.com/dolphin0520/archive/2011/10/02/2198280.html。按照转换规则,写出HexTo

2016-06-26 21:20:27 5699 1

原创 Remove Element

Given an array and a value, remove all instances of that value in place and return the new length.Do not allocate extra space for another array, you must do this in place with constant memory.The order

2016-06-16 20:59:40 237

原创 Rotate Array

Rotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4].思路: 1、以数组右侧第k个元素为界,将一个数组分成两部分。如数组[1,2,3,4,5,6,7],k=3,则分

2016-06-15 14:36:47 264

原创 Contains Duplicate II

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2016-06-14 16:56:53 285

原创 进程间通信1—管道(pipe)和命名管道(FIFO)

进程间通信(Inter-Process Communication,IPC)是用于处理一个多进程系统中各个进程之间的协调。所谓进程间通信,就是指多个进程间相互通信、交换信息的方法。常见的进程间通信方法包括以下几种:管道和命名管道信号消息队列共享内存信号量套接字其中,管道和命名管道、信号、消息队列、共享内存和信号量只适用于本地进程间通信,套接字用于远程通信,因而一般用于网络编程,这里不做

2015-12-05 17:26:25 989

原创 字符串输入gets()、fgets()和字符串输出puts()、fputs()函数

一、字符串输入 想把字符串读到程序中,必须首先预留存储字符串的空间,然后使用输入函数来获取这个字符串。需要分配足够大的存储区来存放希望读入的字符串,不要指望计算机读的时候会先计算字符串的长度,然后为字符串分配空间。常见错误为: char *name; scanf(“%s”, name); 这可能会通过编译,但在读入name的时候

2015-11-26 22:42:18 2125

空空如也

空空如也

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

TA关注的人

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