摘要:
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... 阅读全文
摘要:
#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... 阅读全文
摘要:
N个人围一圈报数,数到3 退出,最后一个是几号(1)自定义链表typedef struct Node{ int value; struct Node* next;}Node ,*Link;Link creat(int n){ Link node=new Node; node-... 阅读全文
摘要:
Sort a linked list inO(nlogn) time using constant space complexity./** * Definition for singly-linked list. * struct ListNode { * int val; * L... 阅读全文
摘要:
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: ... 阅读全文
摘要:
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... 阅读全文
摘要:
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 ... 阅读全文