---
title: "Discussion on \"Introduction to Algorithm Part 2: Bubble Sort and Selection Sort.\" | Hashnode"
description: "Discussion on \"Introduction to Algorithm Part 2: Bubble Sort and Selection Sort.\". This is a series continuation of Introduction to Algorithm: Linear Search versus binary search. Where we also discussed sorted and unsorted searches. You have to go through the first material before jumping on this as it is a continuation and you can..."
url: "https://hashnode.com/posts/introduction-to-algorithm-part-2-bubble-sort-and-selection-sort/645896a0579d30826289e536"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Introduction to Algorithm Part 2: Bubble Sort and Selection Sort.](https://michelle-buchi.hashnode.dev/introduction-to-algorithm-part-2-bubble-sort-and-selection-sort?utm_source=hashnode&utm_medium=feed)

This is a series continuation of Introduction to Algorithm: Linear Search versus binary search. Where we also discussed sorted and unsorted searches. You have to go through the first material before jumping on this as it is a continuation and you can...

May 8, 2023 · 8 min read · michelle-buchi.hashnode.dev  
Updated May 21, 2023  
Read the article

-   [#algorithms](https://hashnode.com/tag/algorithms)
-   [#data-structures](https://hashnode.com/tag/data-structures)
-   [#programming-blogs](https://hashnode.com/tag/programming-blogs)
-   [#selection-sort](https://hashnode.com/tag/selection-sort)
-   [#bubble-sort](https://hashnode.com/tag/bubble-sort)

## Written by

[Michelle Buchi Okonicha](https://hashnode.com/@Michelle-Buchi)

@Michelle-Buchi

  
[View profile](https://hashnode.com/@Michelle-Buchi)

Software engineering, machine learning, web development

Software Engineer | Google Developer Expert | Women Techmakers Ambassador

## Responses 1

Markdown supported · ⌘↵ to post

[Favourite Jome](https://hashnode.com/@Favourite)

[May 8, 2023](https://hashnode.com/posts/introduction-to-algorithm-part-2-bubble-sort-and-selection-sort/645896a0579d30826289e536/comment/64593ef149a8ff3f1d35f12c)

Hi [Michelle Buchi Okonicha](https://hashnode.com/@Michelle-Buchi) Thanks for sharing!

Though I noticed you made a mistake in the Bubble sort example, which propagated through the example snippet.

From the image below, you had \[4,5,1,8, 9,7,2\] and the next items to be swapped are \[9, 7\] and not \[8, 7\] which you used.

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1683570070346/017f459f-2848-44a6-bc39-20800d57bc59.png)

I'm sure you understand the concepts of these algorithms, but I'd say do more research so you can explain them better, especially with the swapCounter variable, at some point, I go lost in your explanation about it.

I'm no expert on this topic, but I just wanted to put that out, Happy writing!

[Michelle Buchi Okonicha](https://hashnode.com/@Michelle-Buchi)

[May 9, 2023](https://hashnode.com/posts/introduction-to-algorithm-part-2-bubble-sort-and-selection-sort/645896a0579d30826289e536/comment/64593ef149a8ff3f1d35f12c#reply-645a39534c568a455ef02139)

Thank you for pointing this out. It will be corrected. Thanks.

[Favourite Jome](https://hashnode.com/@Favourite)

[May 9, 2023](https://hashnode.com/posts/introduction-to-algorithm-part-2-bubble-sort-and-selection-sort/645896a0579d30826289e536/comment/64593ef149a8ff3f1d35f12c#reply-645a3a199197834c2edbe936)

You're welcome [Michelle Buchi Okonicha](https://hashnode.com/@Michelle-Buchi)
