Advertisement
7_2009-2012 Classes/ Frameworks/ OOP #222069

Binary Tree Class

This is a basic binary tree class implemented using templates, so it can be used with any data type. It includes the pre-order, post-order, and in-order traverses.

AI

AI Samenvatting: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Broncode
original-source
Upload
Upload
<?php 
# To count the files displayed
$count = 0;
# open the directory you want to use
$directory = opendir(".");
# Gather the files, and put them in a array
while( $file = readdir( $directory ) )
{
$file_array[] = $file;
}
# Blockquote used for displaying purposes
echo"<blockquote><br>";
# Tell php if it finds a directory to 
# skip over it
foreach( $file_array as $file )
{
if( $file == ".." || $file == "." )
{
continue;
}
			
# Regular expression statement to only echo
# back files with a .php extendtion
# the '.php$' tells the Regular expression statement to 
# only return files with the .php extendion at the end
if( !ereg( ".php$", $file ) )
{	
continue;
}
# Display the file with a link
echo"<font face=\"Tahoma\" size=\"2\">• <a href=\"\php/$file\">$file</a></font><br>";
# Count the file that was displayed
$count++;
}
echo"</blockquote>";
# Display Number of files that were displayed
echo"<font face=\"Tahoma\" size=\"2\">There are <b>$count</b> valid Php Files In the Test Directory</font>";
#close thedirectory you used
closedir($directory);	
?>
Originele reacties (3)
Hersteld van de Wayback Machine