Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An app focused on show in a visual way how sorting algorithms actually works.

NotificationsYou must be signed in to change notification settings

victorpanitz/iOS-SortingAlgorithmsApp

Repository files navigation

Alt text

Sorting Algorithms App

An open source app focused on show in a visual way how sorting algorithms actually works.

Available on the app store

Alt text

Do you want to contribute? Check the backlog

// TODO:

  • New algorithms;
  • Control animation speed;
  • Add algorithm details about the selected algorithm;
  • Improve code coverage (unit tests);
  • More features to the backlog :)

Adding a new algorithm

Create a class implemeting the protocolAlgorithm. Following the example for the classInsertionSort, you'd need to set the title of your algorithm, the image (pick a nice logo representing your algorithm:)) and description. In the methodGenerateSwaps, add the necessary logic to generate all cell swaps which would be necessary.

finalclassInsertionSort:Algorithm{finalvartitle:String="Insertion Sort"finalvarimage:String="ic_insertion"finalvardescription:String="Insertion Sort Description"finalfunc generateSwaps(from list:[Int])->[(x0:Int, x1:Int)]{if list.count==1{return[]}vararray= listvarswaps=[(x0: Int, x1: Int)]()                // APPEND ALL GENERATED SWAPS TO IT'S ARRAYreturn swaps}}

Update the data source with your new algorithm

classAlgorithmsListPresenter{private weakvarview:AlgorithmsListView?privateletrouter:AlgorithmsListRouteringprivateletdataSource:[Algorithm]=[BubbleSort(),InsertionSort(),SelectionSort()]...}

Submiting contributions

Try adding your own solution, feel free to suggest changes on the current code. If you're ready to submit a contribution, create a pull request describing your approach. All contributions are welcome even the small ones.

Contributors

The list ofcontributors:

🇧🇷 -Victor Panitz Magalhães

🇮🇳 -Anantha Krishnan

🇧🇷 -João Reichert

🇨🇳 -urmyfaith

About

An app focused on show in a visual way how sorting algorithms actually works.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors5


[8]ページ先頭

©2009-2025 Movatter.jp