摘要: void temp(int *l,int i,int j){ int t=l[i]; l[i]=l[j]; l[j]=t; }int partition(int *l,int low,int high){ int privotkey=l[low]; whi... 阅读全文
posted @ 2015-04-05 22:40 ~每天进步一点点~ 阅读(152) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h"void temp(int *l,int i,int j){ l[i]=l[i]^l[j]; l[j]=l[i]^l[j]; l[i]=l[i]^l[j];}//使用异或有个问题,当i和j相等时,不能实现交换的目的void HeapSort_M... 阅读全文
posted @ 2015-04-05 22:39 ~每天进步一点点~ 阅读(120) 评论(0) 推荐(0) 编辑
摘要: N个人围一圈报数,数到3 退出,最后一个是几号(1)自定义链表typedef struct Node{ int value; struct Node* next;}Node ,*Link;Link creat(int n){ Link node=new Node; node-... 阅读全文
posted @ 2015-04-05 22:34 ~每天进步一点点~ 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * L... 阅读全文
posted @ 2015-04-05 22:23 ~每天进步一点点~ 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.class Solution {public: ... 阅读全文
posted @ 2015-04-05 21:13 ~每天进步一点点~ 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a canal: Pana... 阅读全文
posted @ 2015-04-05 16:57 ~每天进步一点点~ 阅读(87) 评论(0) 推荐(0) 编辑
摘要: Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see below and ... 阅读全文
posted @ 2015-04-05 15:15 ~每天进步一点点~ 阅读(133) 评论(0) 推荐(0) 编辑