A string is a sequence of characters and a list is a sequence of values, but a list of characters is not the same as a string. To convert from a strin...
分类:
其他好文 时间:
2014-07-15 09:00:12
阅读次数:
244
描述
Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
Do not allocate extra space for another array, you must do this in ...
分类:
其他好文 时间:
2014-07-14 13:46:43
阅读次数:
229
今天做了Leetcode上面一道题Remove Duplicates from Sorted List II,要去去除链表中重复的节点,代码如下 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * ...
分类:
其他好文 时间:
2014-07-13 21:23:10
阅读次数:
160
The + operator concatenates lists: Similarly, the * operator repeats a list a given number of items:List slicesThe slice operator also works...
分类:
其他好文 时间:
2014-07-13 19:42:02
阅读次数:
208
Python provides methods that operate on lists. For example, append adds a new element to the end of a list, extend takes a list as an argument and app...
分类:
其他好文 时间:
2014-07-13 19:16:32
阅读次数:
236
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-07-13 18:20:52
阅读次数:
202
Given two sorted integer arrays A and B, merge B into A as one sorted array.
Note:
You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from ...
分类:
其他好文 时间:
2014-07-13 17:21:40
阅读次数:
208
比如在插入有序链表的过程中,一般情况下要使用俩指针来遍历,而后还要判断是否在第一个位置插入;利用指针的指针后不需要另外考虑这种特殊情况。
代码:
#include
#include
struct node{
int data;
struct node *next;
} *head;
//sorted link-list
void insert(struct no...
分类:
其他好文 时间:
2014-07-13 15:38:13
阅读次数:
198
用gitpull(该命令抓取数据到本地分支后,会自动进行merge操作)抓取远程数据到本地进行分支合并后,出现的一些问题:Q:Xcode无法打开项目S:在解决冲突文件时,对project.pbxproj文件的处理不当引起的,需要仔细鉴别冲突的部分,或者简单的就保留当前分支所属部分,删除合并的分..
分类:
其他好文 时间:
2014-07-13 14:50:50
阅读次数:
208
Apidemos-->Views-Lists-Cursor(people)-主要用到了获取手机联系人信息,属于内容提供者的范畴,要想了解这方面的内容,可以参考官方docs
/sdk/docs/guide/topics/providers/content-provider-basics.html
这里简单说下contentprovider;
contentprovi...