Skip to content

Instantly share code, notes, and snippets.

@5AbhishekSaxena
Created July 15, 2022 20:15
Show Gist options
  • Save 5AbhishekSaxena/2a4b878929b19e2a68fd774de3d1a543 to your computer and use it in GitHub Desktop.
Save 5AbhishekSaxena/2a4b878929b19e2a68fd774de3d1a543 to your computer and use it in GitHub Desktop.
interface SortStrategy {
fun sort(numbers: Array<Int>)
}
class BubbleSortStrategy : SortStrategy {
override fun sort(numbers: Array<Int>) {
println("Numbers are sorted using Bubble sort.")
}
}
class MergeSortStrategy: SortStrategy {
override fun sort(numbers: Array<Int>) {
println("Numbers are sorted using Merge sort.")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment