| 
		
			|  |   |   
 | | Submitted on: 10/2/2002 5:30:59 AM By: Alberto Sartori
 Level: Intermediate
 User Rating: Unrated
 Compatibility:PHP 3.0
 
 Users have accessed this code 637 times.
 
 | (About the author)
 | 
 |    |  |    | Simple bubble sort algorithm. 
 |  | 
|  | 
|  | 
| code: Can't Copy and Paste this?
 Click here for a copy-and-paste friendly version of this code!
 
  | Terms of Agreement:
 By using this code, you agree to the following terms...
 1) You may use 
	 this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
 2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
 3) You may link to this code from another website, but ONLY if it is not wrapped in a frame.
 4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
 |  | 
    //**************************************
    //     
    // Name: Bubble Sort Algorithm
    // Description:Simple bubble sort algori
    //     thm.
    // By: Alberto Sartori
    //
    //This code is copyrighted and has    // limited warranties.Please see http://
    //     www.Planet-Source-Code.com/xq/ASP/txtCod
    //     eId.761/lngWId.8/qx/vb/scripts/ShowCode.
    //     htm    //for details.    //**************************************
    //     
    
    <?php
    //BUBBLE SORT ALGORITHM
    function bubblesort(&$incoming_vector,$outgoing_vector) {
    $chain=0;
    $a=0;
    for($a=$outgoing_vector; $a>0; $a--) {
    $chain=1;
    for($v=0; $v<$outgoing_vector ;$v++) {
    if ($incoming_vector[$v] > $incoming_vector[$v+1]) {
    	 $aux=$incoming_vector[$v];
    $incoming_vector[$v]=$incoming_vector[$v+1];
    $incoming_vector[$v+1]=$aux;
    $chain=$v;
    }
    }
    $outgoing_vector=$chain;
    }
    }
    ?>		 |  | 
| Other 3 submission(s) by this author
 | 
|   | 
|  | 
| Report Bad Submission | 
  |  | 
 |  | 
| Your Vote! | 
| See Voting Log | 
|  | 
| Other User Comments | 
| There are no comments on this submission.
 
 | 
|  | 
    | Add Your Feedback! | 
    | Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name. 
 NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.
 
 For feedback not related to this particular code, please click here.
 
 | 
  |  |