Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift 3 Migration #181

Closed
71 tasks done
chris-pilcher opened this issue Aug 18, 2016 · 35 comments
Closed
71 tasks done

Swift 3 Migration #181

chris-pilcher opened this issue Aug 18, 2016 · 35 comments

Comments

@chris-pilcher
Copy link

chris-pilcher commented Aug 18, 2016

And... we're done!

Thanks everyone for pitching in!


Xcode 8 and Swift 3 will be formally released soon and we need to migrate everything to Swift 3.

Want to help out with the migration? Awesome! :]

Please follow this process for migrating to Swift 3

  • Download the Xcode 8.X
  • Create a pull request to "claim" an algorithm or data structure you'd like to migrate. Just so multiple people don't work on the same thing.
  • Migrate the algorithm/data structure project, playground, tests and readme to Swift 3
    • Uncomment test project in .travis.yml so it will run on our Xcode 8 Travis CI build server
  • Comment in the pull request when the changes are ready to be merged

Suggestions and feedback is welcome!

List of algorithms to be migrated to Swift 3

nil

Completed Migrations

@Jxrgxn
Copy link

Jxrgxn commented Aug 18, 2016

I knew this day would come.

@lostatseajoshua
Copy link
Contributor

@chris-pilcher Will the Swift 3 implementation override the current implementations? Can we add a folder for each algorithm to organize implementations into Swift 2 and Swift 3? They can share the sameREADME for describing the algorithm.

Example of folder structure

- Merge Sort
  - Swift 2
    - Implementation.swift
  - Swift 3
   - Implementation.swift
  - README

@chris-pilcher
Copy link
Author

@lostatseajoshua Thanks for the suggestion! I'm keen to have a single version because of the complexity associated with keeping multiple versions. Potential complications/difficulties I can think of:

  • Keeping multiple versions of the same project/playground/tests in sync
  • Future contributions would require multiple implementations
  • Build server would have to handle multiple versions
  • Handling future versions of Swift

Overall, I think it would be best to overwrite the current Swift 2 implementations.

@lostatseajoshua
Copy link
Contributor

@chris-pilcher Great points! I agree with the difficulties one version will be better. With that point I am going to make a couple PRs to claim some algorithms in Swift 3 👍

@kelvinlauKL kelvinlauKL changed the title Swift 3 Migration - Help needed Swift 3 Migration Sep 7, 2016
@tuliot
Copy link
Contributor

tuliot commented Sep 19, 2016

@kelvinlauKL Linked List was updated with #212 . Can you check it off the todo?

This was referenced Sep 20, 2016
@JaapWijnen
Copy link
Contributor

JaapWijnen commented Sep 21, 2016

The Red-Black tree has been updated with #214
#232 updates Ordered Array to swift 3
#233 updates Priority Queue to swift 3
#234 updates Ordered Set to swift 3

@JaapWijnen
Copy link
Contributor

Red-Black tree can be checked on the list since #214

@ivanicspeter92
Copy link
Contributor

#250 Linked List

@goingreen
Copy link
Contributor

#251 Treap

@JaapWijnen
Copy link
Contributor

Oh sorry didnt see #259 and did similar work in #264

@shashank3369
Copy link

Hello @chris-pilcher, I was wondering if the ones that don't have check marks are the ones that still need to be migrated. If so I would be happy to help.

@kelvinlauKL
Copy link
Member

yep @shashank3369, you're correct.

@mattThousand
Copy link
Contributor

#334 Heap Sort

@grosch
Copy link

grosch commented Jan 1, 2017

I'm not familiar enough with github to know how to properly do the pull/push requests, but here's how I'd rewrite the "Comb Sort" algorithm. That 'while' loop that was in there confused the heck out of me. I think this one is much cleaner.

func combSort(input: [Int]) -> [Int] {
    let shrink = 1.3

    var copy = input
    var gap = copy.count

    while gap > 1 {
        gap = max(1, Int(Double(gap) / shrink))

        for i in 0 ..< copy.count - gap {
            if copy[i] > copy[i + gap] {
                swap(&copy[i], &copy[i + gap])
            }
        }
    }

    return copy
}

@gonini
Copy link
Contributor

gonini commented Jan 3, 2017

#343 Shortest Path (Unweighted)

@gonini
Copy link
Contributor

gonini commented Jan 4, 2017

#345 Minimum Spanning Tree (Unweighted Graph)

@pbodsk
Copy link
Contributor

pbodsk commented Jan 4, 2017

#344 Huffman Coding

@pbodsk
Copy link
Contributor

pbodsk commented Jan 5, 2017

#347 All-Pairs Shortest Paths

@taiheng
Copy link
Contributor

taiheng commented Jan 8, 2017

#349 K-Means

@taiheng
Copy link
Contributor

taiheng commented Jan 8, 2017

#350 Combsort.

@pbodsk
Copy link
Contributor

pbodsk commented Jan 9, 2017

#352 Ternary Search Tree

@taiheng
Copy link
Contributor

taiheng commented Jan 11, 2017

#353 Radix Sort

@pbodsk
Copy link
Contributor

pbodsk commented Jan 12, 2017

All-Pairs Shortest Pairs has been upgraded and merged too (PR #347), so that should be checked of as well, can I do that myself?

@kelvinlauKL
Copy link
Member

Thanks @pbodsk, updated.

@pbodsk
Copy link
Contributor

pbodsk commented Jan 13, 2017

#356 Single-Source Shortest Paths

@naeemshaikh90
Copy link

naeemshaikh90 commented Jan 23, 2017

#270 Combinatorics is migrated to swift 3.

@naeemshaikh90
Copy link

What do we need to migrate in Images? 😀

@kelvinlauKL
Copy link
Member

@naeemshaikh90 Good point, also marked combinatorics as migrated. Thanks 👍

@JaapWijnen
Copy link
Contributor

@kelvinlauKL Just checked, I think Selection Sampling is already written in swift 3. Compiles just fine on my mac.

@kelvinlauKL
Copy link
Member

@JaapWijnen Thanks for the heads up.

@JaapWijnen
Copy link
Contributor

JaapWijnen commented Jan 28, 2017

#364 Run Length Encoding migrated to Swift 3

@JaapWijnen
Copy link
Contributor

#365 Shunting Yard migrated to Swift 3

@JaapWijnen
Copy link
Contributor

#366 Set Cover (unweighted) migrated to Swift 3

@JaapWijnen
Copy link
Contributor

And the last one! #367

@kelvinlauKL
Copy link
Member

Wow @JaapWijnen, you're on a roll 👍

I'll review those later, but for now it seems like we're finally done.

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests