摘要:
静态:static用法:是一个修饰符;用于修饰成员(成员变量和成员函数)当成员被静态修饰后,就多了一种调用方式,除了可以被对象调用外,还可以直接被类名调用格式:类名.静态成员静态的特点:1.随着类的加载而加载也就是,说静态会随着类的消失而消失,说明静态的生命周期最长2.优先于对象的存在明确一点:静态... 阅读全文
摘要:
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two nu... 阅读全文
摘要:
Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjace... 阅读全文
摘要:
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 ... 阅读全文