Bubble Sort
Use Recursion to implement bubble sort.
We'll cover the following
R## Problem statement
Given an array arr
, you need to sort the elements.
Solution: Recursive approach
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order.
Let’s look at the visualization first so we can understand how Bubble Sort works.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.