Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; plgContentJComments has a deprecated constructor in /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php on line 25 Call Stack: 0.0001 360656 1. {main}() /var/www/astarmathsandphysics/index.php:0 0.0507 1209288 2. Joomla\CMS\Application\SiteApplication->execute() /var/www/astarmathsandphysics/index.php:49 0.0507 1209288 3. Joomla\CMS\Application\SiteApplication->doExecute() /var/www/astarmathsandphysics/libraries/src/Application/CMSApplication.php:267 0.1185 4046520 4. Joomla\CMS\Application\SiteApplication->dispatch() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:233 0.1198 4074056 5. Joomla\CMS\Component\ComponentHelper::renderComponent() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:194 0.1205 4091768 6. Joomla\CMS\Component\ComponentHelper::executeComponent() /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:356 0.1206 4122800 7. require_once('/var/www/astarmathsandphysics/components/com_content/content.php') /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:381 0.1216 4145520 8. ContentController->execute() /var/www/astarmathsandphysics/components/com_content/content.php:42 0.1216 4145520 9. ContentController->display() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:710 0.1758 4768352 10. ContentController->display() /var/www/astarmathsandphysics/components/com_content/controller.php:113 0.1783 4869336 11. Joomla\CMS\Cache\Controller\ViewController->get() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:663 0.1788 4890264 12. ContentViewArticle->display() /var/www/astarmathsandphysics/libraries/src/Cache/Controller/ViewController.php:102 0.1874 4955672 13. Joomla\CMS\Plugin\PluginHelper::importPlugin() /var/www/astarmathsandphysics/components/com_content/views/article/view.html.php:189 0.1874 4955928 14. Joomla\CMS\Plugin\PluginHelper::import() /var/www/astarmathsandphysics/libraries/src/Plugin/PluginHelper.php:182 Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; JCommentsACL has a deprecated constructor in /var/www/astarmathsandphysics/components/com_jcomments/classes/acl.php on line 17 Call Stack: 0.0001 360656 1. {main}() /var/www/astarmathsandphysics/index.php:0 0.0507 1209288 2. Joomla\CMS\Application\SiteApplication->execute() /var/www/astarmathsandphysics/index.php:49 0.0507 1209288 3. Joomla\CMS\Application\SiteApplication->doExecute() /var/www/astarmathsandphysics/libraries/src/Application/CMSApplication.php:267 0.1185 4046520 4. Joomla\CMS\Application\SiteApplication->dispatch() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:233 0.1198 4074056 5. Joomla\CMS\Component\ComponentHelper::renderComponent() /var/www/astarmathsandphysics/libraries/src/Application/SiteApplication.php:194 0.1205 4091768 6. Joomla\CMS\Component\ComponentHelper::executeComponent() /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:356 0.1206 4122800 7. require_once('/var/www/astarmathsandphysics/components/com_content/content.php') /var/www/astarmathsandphysics/libraries/src/Component/ComponentHelper.php:381 0.1216 4145520 8. ContentController->execute() /var/www/astarmathsandphysics/components/com_content/content.php:42 0.1216 4145520 9. ContentController->display() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:710 0.1758 4768352 10. ContentController->display() /var/www/astarmathsandphysics/components/com_content/controller.php:113 0.1783 4869336 11. Joomla\CMS\Cache\Controller\ViewController->get() /var/www/astarmathsandphysics/libraries/src/MVC/Controller/BaseController.php:663 0.1788 4890264 12. ContentViewArticle->display() /var/www/astarmathsandphysics/libraries/src/Cache/Controller/ViewController.php:102 0.3107 12511888 13. JEventDispatcher->trigger() /var/www/astarmathsandphysics/components/com_content/views/article/view.html.php:199 0.3110 12512288 14. plgContentJComments->update() /var/www/astarmathsandphysics/libraries/joomla/event/dispatcher.php:160 0.3110 12512288 15. plgContentJComments->onContentAfterDisplay() /var/www/astarmathsandphysics/libraries/joomla/event/event.php:70 0.3112 12520536 16. plgContentJComments->onAfterDisplayContent() /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php:339 0.3114 12522272 17. JComments::show() /var/www/astarmathsandphysics/plugins/content/jcomments/jcomments.php:282 0.3121 12555320 18. JCommentsFactory::getACL() /var/www/astarmathsandphysics/components/com_jcomments/jcomments.php:188 0.3121 12555720 19. spl_autoload_call() /var/www/astarmathsandphysics/components/com_jcomments/classes/factory.php:274 0.3122 12555800 20. JLoader::load() /var/www/astarmathsandphysics/components/com_jcomments/classes/factory.php:274

The Insertion Sort

The insertion sort orders a list alphabetically or in order of size by picking the from the unsorted list and placing it in in alphabetical or numerical order in the ordered list as it is built up. This is repeated until all the elements in the unordered list have been transferred to the ordered list. The process is the way many people use to order a set of objects.

For example, to sort the list

4, 2, 5, 8, 1, 7, 9

The first number in the list is 4, so the ordered list starts with a 4:

4

The next number in the list is 2 and this is smaller than 4, so goes before it.

2, 4

The next number in the list is 5 and this is the largest number so far, and goes last.

2, 4, 5

The next number in the list is 5 so this is swapped with the fourth number to give the list

2, 4, 5, 8

The next number in the list is 1 and this is is the smallest of any so far and goes first.

1, 2, 4, 5, 8

The next is 7, and is placed in front of the 8.

1, 2, 4, 5, 7, 8

Finally, the 9 is placed last to give the ordered list

4, 2, 5, 8, 1, 7, 9

Add comment

Security code
Refresh