-
-
Save 5AbhishekSaxena/2a4b878929b19e2a68fd774de3d1a543 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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