binarysearch.h

来自「小程序,VC++处学者用的,关于二分法查找的 经典的BINARYSEARCH算法」· C头文件 代码 · 共 28 行

H
28
字号
//************      BinarySearch.h      *************

# ifndef BINARYSEARCH_H
# define BINARYSEARCH_H

#include <iostream>
using namespace std;


class Binarysearch
{
public:
	Binarysearch( int *xbptr,int xsearchKey,int xlow,int xhigh,int xsize );//constructing function
	int bSearch ( int a, int b[ ] );  // search element a in the array of b
	void sort( int xa[], int xsize ); // sort the numbers you input
	~Binarysearch();                  // destructing function

private:
	
	int size;         // size of the array you input
	int * bptr;       // point to the array 
	int a;            //the number you search
	int low;          //  0
	int high;         // n-1
	
};

# endif;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?