摘要:
package ming;interface Teachable { void work();}class Programer { private String name; public String getName() { return name; } public void setName(S... 阅读全文
摘要:
package ming;class Outer { class In { public In(String msg) { System.out.println(msg); } }}public class InTest extends Outer.In { public InTest(Ou... 阅读全文
摘要:
1. 接口只能定义抽象方法,不包含已经提供实现的方法。 抽象类可以包含普通方法2. 接口不能定义静态方法。抽象类可以定义静态方法3. 接口里只能定义静态常量filed,不能定义普通filed。 抽象类可以定义普通field,也可以定义静态filed。4. 接口里面不包含构造器,抽象类可以包含构造器,... 阅读全文
摘要:
package ming;public class CacheImmutale { private static int MAX_SIZE = 10; private static CacheImmutale[] cache = new CacheImmutale[MAX_SIZE]; privat... 阅读全文
摘要:
#include #include using namespace std;int compared(const void *key1,const void *key2){ //cout*iKey2){ //coutj) { //the left elements has no more elements to merge while(jposk) { //right division has no more elements to merge. while(ipos<=j) { memcpy(&m[mpos*esize],&a[ipos*esize],esize... 阅读全文
摘要:
//合并有序数组//合并例子void MemeryArray(int a[], int n, int b[],int m, int c[]){ int i,j,k; i=j=k=0; while(i<n && j<m) { if(a[i]<b[j]) { c[k++] = a[i++]; } else { c[k++]=b[j++]; } } while(i<n) { c[k++]=a[i++]; } while(j<n) { c[k++] = b[j++]; }}//排序需要调用的如下//排序调用bool MergeSort(int a[], i 阅读全文
摘要:
//比较大小static int compare_int(const void *int1,const void *int2){ if(*(const int*)int1>*(const int*)int2) { return 1; } else if(*(const int*)int1=0&&compare(&a[i*esize],key)>0){ memcpy(&a[(i+1)*esize],&a[i*esize],esize); i--; cout0); do{ // cout= k) { // cout<<"do 阅读全文
摘要:
void quick_sort(int s[],int l,int r){ if(l= x) { j--; } if(i<j) { s[i++]=s[j]; } while(i<j && s[i]<x) { i++; } if(i<j) { s[j--]=s[i]; } } s[i]=x; quick_sort(s,l,i-1); quick_sort(s,i+1,r); } 阅读全文
摘要:
//用于比较大小int compared(const void *key1,const void *key2){ cout*iKey2){ //cout=0&&compare(&a[i*esize],key)>0){ memcpy(&a[(i+1)*esize],&a[i*esize],esize); i--; cout<<i<<endl; } memcpy(&a[(i+1)*esize],key,esize); } free(key); return 0; }} 阅读全文
摘要:
void issort2(int a[],int n){ int temp=0; int i=0,j=0; for(i=1;i=0 && a[j]>temp) { a[j+1]=a[j]; j--; } a[j+1]=temp; }} 阅读全文