Chinaunix首页 | 论坛 | 博客
  • 博客访问: 650995
  • 博文数量: 160
  • 博客积分: 2384
  • 博客等级: 大尉
  • 技术积分: 1366
  • 用 户 组: 普通用户
  • 注册时间: 2008-12-01 11:35
文章分类
文章存档

2015年(45)

2014年(36)

2012年(28)

2011年(37)

2010年(2)

2009年(10)

2008年(2)

发布时间:2014-11-14 12:42:02

7. 插入排序  Insertion Sort    插入排序最好的运行时间是O(n),已经排序好了情况下,平均情况最情况都是O(n2),所以处理随机的未排序数据时并不是好的算法。    通过将每个新元素与已经排序好的元素做比较,并将其插入到正确的位置来建立一个排序的数组,就像玩扑克一样,拿到新的牌放入到已.........【阅读全文】

阅读(1352) | 评论(0) | 转发(1)

发布时间:2014-11-13 23:29:27

1. 冒泡排序点击(此处)折叠或打开// test_manda.cpp : Defines the entry point for the console application.//#include "stdafx.h"void budleSort(int *a, int n);void testBubleSort(int *a, int len);.........【阅读全文】

阅读(971) | 评论(0) | 转发(1)

发布时间:2014-11-05 16:57:09

// 方法一, 循环实现ListNode* Merge(ListNode* pHead1, ListNode* pHead2){    if(pHead1 == NULL)        return pHead2;    else if(pHead2 == NULL)        return pHead1;    ListNode* pMergedHead = NULL;    ListNode*.........【阅读全文】

阅读(589) | 评论(0) | 转发(0)

发布时间:2014-11-05 13:55:20

// 方法一, 递归实现ListNode* ReverseList(ListNode* pHead){    return ReverseListRecursive(NULL,pHead); }// 返回反转后的头结点ListNode* ReverseListRecursive(ListNode* pPrev, ListNode* pNode){    // 空链表    if (pNode == NULL)    {&nb.........【阅读全文】

阅读(470) | 评论(0) | 转发(0)

发布时间:2014-11-04 23:47:41

// 方法strcatchar*strcat(char *strDest, const char *strSrc){         assert((strDest != NULL) &&(strSrc != NULL));         char *address = strDest;          while.........【阅读全文】

阅读(451) | 评论(2) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册