Algorithms, elastic search, Linux, web

glitch in BringMeFast.com Search Engine – solved

There was problem in loading the page very first time. It was showing empty page. Issue was in security check. Solved this now. Enjoy searching. you can help and suggest me more on this here. [email protected] is my new email id. Here is the link bringmefast.com. Enjoy searching.

Topic:glitch in BringMeFast.com Search Engine – solved

Algorithms, PHP

Php program for insertion sort, Easy implementation

Php program for insertion sort. Easy implementation.

here is the link just try once https://github.com/vishvendrasingh/insertion_sort

<?php
/**Function for sorting an array with insertion sort algorithm.
*
* @param array $array
* @return array
*/
function insertionSort(array $array) {
$length=count($array);
for ($i=1;$i<$length;$i++) {
$element=$array[$i];
$j=$i;
while($j>0 && $array[$j-1]>$element) {
//move value to right and key to previous smaller index
$array[$j]=$array[$j-1];
$j=$j-1;
}
//put the element at index $j
$array[$j]=$element;
}
return $array;
}
$array = range(0, 19);
shuffle($array);
var_dump($array);
$arr = insertionSort($array);
var_dump($arr);
?>

here is the link just try once https://github.com/vishvendrasingh/insertion_sort