Skip to main content

Posts

Featured

what is Bubble sorting..?

Bubble Sorting Bubble Sort  is an algorithm which is used to sort  N  elements that are given in a memory for eg: an Array with  N  number of elements. Bubble Sort compares all the element one by one and sort them based on their values. It is called Bubble sort, because with each iteration the smaller element in the list bubbles up towards the first place, just like a water bubble rises up to the water surface. Sorting takes place by stepping through all the data items one-by-one in pairs and comparing adjacent data items and swapping each pair that is out of order. Above is the algorithm, to sort an array using Bubble Sort. Although the above logic will sort and unsorted array, still the above algorithm isn't efficient and can be enhanced further. Because as per the above logic, the for loop will keep going for six iterations even if the array gets sorted after the second iteration. Hence we can insert a flag and can keep checking whether swapping of elements is taking place or no

Latest Posts

top 10 most famous hacker's

what is pseudocode

Top 10 Viruses that are really brutal Author: Sri Nikhil Reddy