Skip to content

Third quicksort#3

Open
oleksiipet wants to merge 7 commits into
hyperskill:masterfrom
oleksiipet:third-quicksort
Open

Third quicksort#3
oleksiipet wants to merge 7 commits into
hyperskill:masterfrom
oleksiipet:third-quicksort

Conversation

@oleksiipet

Copy link
Copy Markdown

No description provided.

Comment thread src/phonebook/Main.java Outdated
int cnt = 1;
for (String request : requests) {
Contact contact;
if ((contact = search(contacts, request)) != null) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I think Objects.isNull(...) is better.

Comment thread src/phonebook/Main.java
int j = lo + 1;
for (int i = lo + 1; i <= hi; i++) {
if (pivot.getName().compareTo(contacts.get(i).getName()) >= 0) {
int comparing = Objects

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Now all the code looks better! You may also generalize your methods for sorting with and then move the method in a separated class with sorting utils. But it is not required for this project. Just to have an additional practice.

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

Successfully merging this pull request may close these issues.

3 participants