This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int searchBinary(int arrayList[],int findNum,int first , int last ){ | |
| while(first<=last){ | |
| int middle =( last+first)/2; | |
| if(arrayList[middle]==findNum) | |
| return middle; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| int searchItem(int sist[],int item,int sizeList){ | |
| int position=0; | |
| while(position<(sizeList-1)){ | |
| if(sist[position]==item){ | |
| break; | |
| }else{ | |
| position++;} | |
| } | |
| return position; | |
| } |
NewerOlder