Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Bas Jobsen  >  Mergesort  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: example
Class: Mergesort
Mergesort produces a sorted sequence of a array
Author: By
Last change:
Date: 2002-09-07 12:46
Size: 313 bytes
 

Contents

Class file image Download
<?
include('Mergesort.php');
$M=new Mergesort;
$array=array('8','10','2','1','1','6','5','5','3');

$part=$M->MS_get($array,2,5);

for(
$i=0;$i<count($part);$i++)
        echo 
$part[$i]."\n";

echo 
"\n";

$M->Merge_sort($array,0,count($array)-1);
for(
$i=0;$i<count($array);$i++)
        echo 
$array[$i]."\n";
?>