Skip to content

Fix quick sort#8

Open
FeschenkoNatalia wants to merge 1 commit into
masterfrom
fix_quick_sort
Open

Fix quick sort#8
FeschenkoNatalia wants to merge 1 commit into
masterfrom
fix_quick_sort

Conversation

@FeschenkoNatalia

Copy link
Copy Markdown
Member

No description provided.

@@ -1,4 +1,3 @@

const should = require('should');
const algo = require('../../index.js');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can your algorithm sort numbers less than 0?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can you sort strings?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Cant you sort in descend order?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

According to your questions, my algorithm can sort numbers less than 0 and strings.
All necessary tests were added and passed.
But you are right it can't sort in the descend order.

@@ -1,3 +1,4 @@

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorting function should take 2 arguments

  • array of elements
  • function comparator, to compare elements

@pavlom0x

pavlom0x commented Apr 9, 2018

Copy link
Copy Markdown
Member

Same notes applicable to all sorting methods

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.

2 participants