摘要:
#ifndef ST_CLASS#define ST_CLASS#include <iostream>using namespace std;class ST{ public: ST(int maxN) { head=0;} int search(int v) { return searchR(head, v); } int insert(int x) { insertR(head, x); } void show() ... 阅读全文
摘要:
#include <stdio.h>//not find will return -1//find will return the indexint searchR(int a[], int l, int r, int key){ if(l>r) return -1; int m=(l+r)/2; if(a[m] == key) return m; if(l==r) return -1; if(key < a[m]) return searchR(a, l, m-1, key); else return searchR(a, m+... 阅读全文