in

I present you: The Miracle Sort

miracle sort meme

Introduction

Prerequisites: Miracles, Sense of Humour

Miracle sort is a sort that truly requires a miracle. We keep checking the array until it is sorted.

It requires that some external force (a miracle?) changes some bits in the computer in a way that it becomes sorted.

Implementation

We keep checking if the array is sorted until some miracle occurs.

Code

public void miracleSort(int[] arr) €

boolean sorted = false;

do {

sorted = true;

for (int i = 1; i < arr.length; i++) (

if (arr[i] < arr[i – 1]) €

sorted = false;

break;

} while (!sorted):

What do you think?

Written by codeitbro

Codeitbro.in is a hub of funny coding and programming memes. Explore memes on various topics such as cybersecurity, Linux, Software Testing, and many others.

Leave a Reply

Your email address will not be published. Required fields are marked *

GIPHY App Key not set. Please check settings