コード例 #1
0
ファイル: Test.php プロジェクト: philipthelord/collegedays
 <?
 include_once('/var/www/html/src/php/CDPriorityQueue.php');

 $PQ = new CDPriorityQueue();
 $PQ -> insert('A',1);
 $PQ -> insert('B',4);
 $PQ -> insert('C',2);
 $PQ -> insert('D',3);
 $PQ -> insert('F',10);
 echo $PQ -> top();

?>
コード例 #2
0
ファイル: index.php プロジェクト: philipthelord/collegedays
					
					$newMatchResult = $newMatch->create($User->ID, $nextUser->ID);
					if($debug) echo "Match creation result: ".$newMatchResult."<br> was test: ".$newMatch->istest;
					
					$User->setMatched(true);
					$User->setLastRow($nextRow);
					$nextUser->setMatched(true);
					
					$Match = $newMatch;
					
					$stillMatching = false;
				}
				else if($nextUser -> row['currentMatched'] == 0)//if they are not matched and we could not match them
				{
					if($debug) echo "Inserting ".$nextUser->row['fName']." with priority of ".$matchCount."<br>";
					$PQ -> insert($nextUser -> ID, $matchCount);
				}
			}
			else
			{
				// if($debug) echo " didnt exist...";
			}
			
			if ($count > $maxRow)
			 $stillMatching = false;
			
			$count++;
			$nextRow++;
		} 
	}
	else