About 50 results
Open links in new tab
  1. Proof of the Bubblesort algorithm - Computer Science Stack Exchange

    Dec 7, 2020 · 0 I'm studying The Algorithm Design Manual and I was having some difficulty in the proof exercises, so I asked a question here. Based on the answer I got in that question (which was not the …

  2. Bubble sort: how to calculate amount of comparisons and swaps

    Oct 15, 2019 · For a given sequence 1, N ,2 ,N −1 ,3, N −2, ... I want to calculate the number of comparisons and swaps for bubble sort. How can I accomplish that using $\theta ()$ notation? I …

  3. algorithms - Why does bubble sort do $\Theta (n^2)$ comparisons on …

    Feb 25, 2013 · I have a quick question on the bubble sort algorithm. Why does it perform $\\Theta(n^2)$ comparisons on an $n$ element list? I looked at the Wikipedia page and it ...

  4. Bubble Sort with "while" loop - why is average case n^2?

    There is an ambiguity in the specification of the bubble sort algorithm given in the start of the post. In fact, there are multiple versions of the bubble sort algorithm.

  5. Modified Bubble Sort's time complexity - Computer Science Stack …

    Jan 19, 2023 · 1 Bubble Sort's time complexity of $\Theta (n^2)$ is not good — it is a common worst-case complexity class for simple sorting algorithms that do not use divide & conquer methods to …

  6. Evaluating the average time complexity of a given bubblesort …

    For clarification on the term average-time: This sorting algorithm will need different time on different lists (of the same length), as the algorithm might need more or less steps through/within the loops until …

  7. sorting - A different algorithm called the 'bubble sort'? - Computer ...

    Aug 3, 2022 · This process is continued for all the elements until the next-to-the-last, at which time the array is assumed to be ordered. This sounds to me like it is very different from what is commonly …

  8. algorithms - Bubble sort on an already sorted collection - Computer ...

    Oct 2, 2021 · The only significant advantage that bubble sort has over most other algorithms, even quicksort, but not insertion sort, is that the ability to detect that the list is sorted efficiently is built into …

  9. Bubble Sort: Runtime complexity analysis line by line

    Aug 20, 2020 · I haven't found a line by line analysis like the Intro to Algorithms line by line analysis of this algorithm online, but only multiplied summations of the outer and inner loops. For each line of …

  10. algorithms - Why is selection sort faster than bubble sort? - Computer ...

    It is written on Wikipedia that "... selection sort almost always outperforms bubble sort and gnome sort." Can anybody please explain to me why is selection sort considered faster than bubble sort ...