码迷,mamicode.com
首页 >  
搜索关键字:list    ( 54897个结果
【Leedcode】Insertion Sort List
Sort a linked list using insertion sort. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *nex...
分类:其他好文   时间:2014-06-10 12:14:19    阅读次数:253
leetcode--Partition List
Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve the origi...
分类:其他好文   时间:2014-06-10 12:06:09    阅读次数:205
赵雅智_ListView_SimpleAdapter
项目步骤 声明listView控件并获取显示的视图获取显示的数据设置显示的adapter注册点击事件 具体案例 实现效果: 查找的方法 public List> getData() { SQLiteDatabase db = dh.getWritableDatabase(); List> data = new ArrayList>(); Cursor c...
分类:其他好文   时间:2014-06-10 10:55:23    阅读次数:193
【leetcode】Linked List Cycle
问题: 给定个单链表,判断该链表是否存在环。 分析: 这个问题是见的非常多的题目,问题本身而言,技巧性很强,或者说思路很巧妙,这里要说的不是这个题目本身,而是说这种技巧,在很多的地方是用的到的,比如,在寻找单链表的中间节点的时候,就可以用这种形式,一个走两步,一个走一步的形式,来获得中间节点。 // bool hasCycle(ListNode *head) { if(...
分类:其他好文   时间:2014-06-10 10:48:49    阅读次数:176
*湖南师范大学第五届大学生计算机程序设计竞赛(AKing)
【比赛链接】:http://acm.hunnu.edu.cn/online/?action=problem&type=list&courseid=132A:跑得快计数程序【题解】:细心点,巧妙乘2处理四舍五入,简单模拟【代码】: 1 #include 2 #include 3 #include .....
分类:其他好文   时间:2014-06-10 10:40:22    阅读次数:227
【leetcode】Convert Sorted List to Binary Search Tree
问题: 给定一个有序链表,生成对应的平衡二叉搜索树。 分析 见Convert Sorted Array to Binary Search Tree 实现: TreeNode *buildTree(ListNode* head, ListNode *end){ if(head == NULL || head == end) return NULL; ...
分类:其他好文   时间:2014-06-10 07:17:29    阅读次数:264
替换字符串中美元大括号的字符串
import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 创建日期:2014年6月9日 17:23:29 ...
分类:其他好文   时间:2014-06-10 07:14:48    阅读次数:164
[Erlang]如何在Erlang中将对list进行json编码?
Json编码,在python里就是一句话: json.dumps(user_data) 但是Erlang没有自带的Json模块,只能自己造轮子: 先下载mochijson2: https://github.com/mochi/mochiweb/blob/master/src/mochijson2.erl 用erlc编译 然后,上代码: get_json_data() -> ...
分类:Web程序   时间:2014-06-10 06:46:21    阅读次数:309
Plus One
题目 Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is at the head of the list. 方法 ...
分类:其他好文   时间:2014-06-10 06:12:06    阅读次数:285
Java一个方法使用可变参数技巧
很久没有写日志了,最近由于项目紧张在研究一些Java的反射机制,想利用该机制更好的完善和封装项目还有代码,今天在研究反射时,沈阳斌子遇到一个问题就是封装一个方法时有可变参数的问题,经上网查找找到如下方式和技巧。 编写Java程序时,经常会遇到一个方法需要多个参数的情况。例如一个求和方法: public int add(int[] list){ int sum = 0; for ...
分类:编程语言   时间:2014-06-10 06:08:52    阅读次数:408
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!