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

Update README.markdown #60

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

Closed
jherna37 wants to merge 2 commits into kodecocodes:master from jherna37:patch-1
Closed

Conversation

@jherna37
Copy link

@jherna37 jherna37 commented Feb 29, 2016

My native programming language is Java and I am new to swift. To the best of my knowledge I have translated from Java to Swift. Thanks for the opportunity and don't be afraid to hurt my feelings. I'm open to any feedback. This was merely the first step of many.

Copy link
Member

hollance commented Mar 1, 2016

Swift 3.0 is going to come out later this year and it removes this kind of for loop:

for var j = 0; j < array.count; j++

I also think you can get rid of the if i + 1 < count line if you make the loop for i go from 0 to count-1.

You can swap two array elements in Swift with: swap(&a[i], &a[j]), so no need to use a temporary variable.

It is possible to make the bubble sort a little bit more efficient: if no swap was necessary, then the sort is done and you can exit the loop.

That should give you something to do. ;-)

Copy link
Member

@jherna37: Is this something you're willing to work on some more?

Copy link
Author

Hey sorry for the delay. I just finished my mid term exams and haven't had
much time since my first submission to work on it.

On Fri, Mar 18, 2016 at 4:16 AM, Matthijs Hollemans <
notifications@github.com> wrote:

@jherna37 https://github.com/jherna37: Is this something you're willing
to work on some more?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#60 (comment)

Copy link
Member

No worries. I'll just leave this open until you get a chance to work on it again.

Copy link
Author

Just for clarification, would you like me to implement this algorithm without the use of for loops?

Copy link
Member

You can still use for loops, but it must be for in, not for var i = ...; ... ; ... since the latter is now deprecated in Swift.

Copy link
Author

jherna37 commented Apr 6, 2016

I've made the changes to the code. I was wondering if instead of radix sort you'd be open to more algorithm interview questions. I have a few examples from an interview I just came back from and think they'll make a nice addition.

Copy link
Member

hollance commented Apr 7, 2016

Have you actually tried out those changes? I'm pretty sure it doesn't work like that...

Interview questions are very welcome! We already have a few simple ones, but more is better. :-)

Copy link

Hi @jherna37. We're in the process of cleaning up our pull requests.

Would you still like to work on the bubble sort algorithm?

Copy link
Member

Closing this due to inactivity. @jherna37 feel free to open another PR if you're up for another shot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /