sorting

Sorting technique

Sorting Techniques Sorting is a process to arrange the records in the file in an order(either ascending or descending) with respect to the key. Sorting can be divided into two types of categories called internal and external sorting based on location of records at the time of sorting. The characteristics of sorting methods are – […]

Share

Sorting technique Read More »

Arrays and Functions

Array is a structure storing elements of similar data types sequentially in memory. Subscript Array is a structure storing elements of similar data types sequentially in memory (Index) is a variable through which the elements of the array are processed. Array size is maximum number of elements an array can hold. Rules for Arrays:- An

Share

Arrays and Functions Read More »

PHP Array and Compressing Data

Following example shows that use of an array to sort records in ascending and descending order using PHP program. <?php $arr = array(‘Apple’, ‘Zensor’, ‘MITIndia’); echo “<br><b>Without sorted values are..</b><br>”; echo $arr[0], “<br>”; echo $arr[1], “<br>”; echo $arr[2], “<br>”; echo “<br><b>Sorted values are..</b><br>”; sort($arr); $len=count($arr); for($i=0; $i<$len; $i++) { echo $arr[$i], “<br>”; } echo “<br><b>Reverse

Share

PHP Array and Compressing Data Read More »

Share
Scroll to Top