码迷,mamicode.com
首页 >  
搜索关键字:sort list    ( 66297个结果
android 工具类 数据库管理
数据库工具类,优雅的管理android中的sqlite package csdn.shimiso.eim.db; import java.util.ArrayList; import java.util.List; import android.content.ContentValues; import android.database.Cursor; import android.da...
分类:移动开发   时间:2014-06-03 05:11:12    阅读次数:394
Iterative (non-recursive) Quick Sort
An iterative way of writing quick sort: #include #include #include using namespace std; void quickSort(int A[], int n) { stack> stk; stk.push(make_pair(0, n-1)); while (!stk.empty()) { pair ...
分类:其他好文   时间:2014-06-03 00:16:43    阅读次数:357
LeetCode: Partition List [086]
【题目】 Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes in each of the two partitions. For example, Given 1->4->3-...
分类:其他好文   时间:2014-06-03 00:02:29    阅读次数:270
Android清理设备内存详细完整示例(二)
MainActivity如下: package cc.c; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.util.List; import android.app.Activity; import android.app.ActivityMan...
分类:移动开发   时间:2014-06-02 23:53:57    阅读次数:503
使用函数指针,完成一个sort()函数,能对任何类型的数组元素进行排序: 回调函数 以及 memcpy ()原型实现
进来复习了一下C语言指针,一直没有写过太多关于函数指针的代码,而且对回调函数的理解一直都是在理论上,基本上没有太写过关于它的代码,进来得空,写了一个小程序加深下自己对回调函数和函数指针的理解。 问题描述: 编写一个sort()函数,使它能够对任何类型的数组元素进行排序。 下面是我写的代码: /* 使用函数指针的回调函数技巧,设计一个能排序int 和char 数组的sort()函...
分类:其他好文   时间:2014-06-02 23:16:49    阅读次数:471
HashMap的两种排序方式
Map map = new HashMap(); map.put("d", 2); map.put("c", 1); map.put("b", 1); map.put("a", 3); List> infoIds = new ArrayList>(map.entrySet()); //排序前 for (int i = 0; i < infoIds.size(); i++) { ...
分类:其他好文   时间:2014-06-02 23:05:01    阅读次数:279
每日算法之二十二:Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space....
分类:其他好文   时间:2014-06-01 10:41:23    阅读次数:242
JDK源码学习----ArrayList
JDK源码学习----ArrayList 1.ArrayList简介 ArrayList是基于Object[] 数组的,也就是我们常说的动态数组。它能很方便的实现数组的增加删除等操作。 public class ArrayList extends AbstractList implements List, RandomAccess, Cloneable, java.io.Se...
分类:其他好文   时间:2014-06-01 09:42:27    阅读次数:263
每日算法之二十三:Reverse Nodes in k-Group
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it is...
分类:其他好文   时间:2014-06-01 09:05:42    阅读次数:271
redis学习
Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。 redis是一个key-value存储系统。和Memcached类似,它支持存储的value类型相对更多,包括string(字符串)、list(链表)、set(集合)、zset(sor...
分类:其他好文   时间:2014-06-01 08:49:50    阅读次数:457
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!