Skip to content

Selection Sort assignment solution#4

Closed
aranasaurus wants to merge 1 commit into
gmertk:masterfrom
aranasaurus:assignment001-solution
Closed

Selection Sort assignment solution#4
aranasaurus wants to merge 1 commit into
gmertk:masterfrom
aranasaurus:assignment001-solution

Conversation

@aranasaurus
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have any particular reason to use startIndex and endIndex here? for j in 0..<array.count - 1 would do the same?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally lean toward using start/endIndex for future-proofing, I guess. In this case we know it's an Array and therefore its index is Int, so it's unnecessary, but I've gotten into the habit of using the methods on the protocol (CollectionType) when I can.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep makes sense 😄 Thanks for the PR!

@gmertk gmertk closed this Nov 27, 2015
diegopetrucci added a commit to diegopetrucci/SwiftAlgorithmsClassroom that referenced this pull request Jan 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants