Bubble sort is a simple sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. Here's how to implement bubble sort in an array using JavaScript:
index.tsx419 chars19 lines
A stack is a collection of elements, where elements are stored and retrieved based on last-in-first-out (LIFO) principle. Here's how to implement bubble sort in a stack using JavaScript:
index.tsx951 chars47 lines
A linked list is a linear data structure where each element is a separate object. Linked list elements are not stored at contiguous memory locations. Here's how to implement bubble sort in a linked list using JavaScript:
index.tsx1621 chars77 lines
gistlibby LogSnag