Merge Two Sorted Lists:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the fi...
分类:
编程语言 时间:
2014-09-15 01:02:17
阅读次数:
269
package com.demo;import java.util.ArrayList;import java.util.List;public class SearchSort{ public List quickSort(List list, int from, int to) ...
分类:
其他好文 时间:
2014-09-15 00:58:47
阅读次数:
215
Selection sort导言:(取自Wiki)Incomputerscience,selectionsortisasortingalgorithm,specificallyanin-placecomparisonsort.IthasO(n2)timecomplexity,makingitinef...
分类:
其他好文 时间:
2014-09-14 23:21:37
阅读次数:
240
P4:用已给的list.h编写一个双向链表,使其可以进行以下操作: 1.初始化链表 2.在链表最后处添加一个string 3.清空链表 4.依次print链表中所有的元素 5.用bubble sort将链表中所有元素排列成按字母顺序排列(类似字典) PS:bubble sort时换位不可直接互换st...
分类:
编程语言 时间:
2014-09-14 19:18:37
阅读次数:
204
[Shell学习笔记] sort、uniq命令对文本进行排序、单一和重复操作文章目录[隐藏]sort命令语法常用选项sort常见用法uniq命令命令选项uniq用法sort是在Linux里非常常用的一个命令,它将文件进行排序,并将排序结果标准输出。sort命令既可以从特定的文件,也可以从stdin中...
分类:
其他好文 时间:
2014-09-14 17:58:47
阅读次数:
390
前天简单分享了用shell写网络爬虫的一些见解,今天特地把代码发出来与51博友分享,还是那句话,爱技术、爱开源、爱linux。针对脚本的注解和整体构思,我会放到脚本之后为大家详解。#!/bin/bash
#
#Thisscriptisusedtograbthedataonthespecifiedindustrywebsites
#Writtenbysuns..
分类:
其他好文 时间:
2014-09-14 11:27:27
阅读次数:
295
Sort a linked list in O(n log n) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * ...
分类:
其他好文 时间:
2014-09-13 21:25:35
阅读次数:
288
#include
#include
#include
using namespace std;
int main()
{
int a[5] = {1, 5, 4, 2, 3};
sort(a, a + 5, greater()); //less()
for(int i = 0; i < 5; ++i)
printf("%d ", a[i]);...
分类:
其他好文 时间:
2014-09-13 20:10:05
阅读次数:
168
Sort a linked list inO(nlogn) time using constant space complexity. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int ...
分类:
其他好文 时间:
2014-09-13 20:08:05
阅读次数:
204
Sort a linked list using insertion sort. 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *nex...
分类:
其他好文 时间:
2014-09-13 20:05:15
阅读次数:
180