Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as C++ by dani ( 15 years ago )
connection search(int val){
  unsigned int indexmiddle=ice.size()/2;
  unsigned int indexright=ice.size-1;
  unsigned int indexleft=0;

  while(1){
 indexmiddle=indexleft+((indexleft-indexright)/2);
 if(indexright<indexleft){
     throw"gesuchte Connection nicht gefunden";
 }

 if (ice[indexmiddle]==val){
   return ice[indexmiddle];
 }

 if(ice[indexmiddle]>val){
   indexright=indexmiddle-1;
 }

 else indexleft=indexright+1; 
  }

 

Revise this Paste

Your Name: Code Language: