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

Quicksort filename explanation #42

Closed
dey-dey opened this issue Feb 19, 2018 · 4 comments
Closed

Quicksort filename explanation #42

dey-dey opened this issue Feb 19, 2018 · 4 comments

Comments

@dey-dey
Copy link

dey-dey commented Feb 19, 2018

from https://github.com/beaunus/stanford-algs/tree/master/testCases/course1/assignment3Quicksort

File names contain 4 relevant values:

n
the number of integers
first
the number of comparisons using the first element of the array as the pivot element
final
the number of comparisons using the final element of the array as the pivot element
median
the number of comparisons using the median-of-three of the array as the pivot element

can you please explain what that means for file input_dgrcode_01_5.txt with values:

3
2
1
4
5
@dgrcode
Copy link
Collaborator

dgrcode commented Feb 24, 2018

Hi dey-dey,

The name of the file is: [input|output]_${creator}_${order}_${size}.

In that specific case the creator was me. The order means that it was the first file of the group of files I created. The size is the input size.

That file has input size 5, so its contents for this specific assignment are all positive integers from 1 to 5 in an unsorted order.

I'm not sure if that answers your question. Let me know if it doesn't so I can clarify.

@dey-dey
Copy link
Author

dey-dey commented Feb 25, 2018

Ah I see! I guess the readme is not correct. Is there any way to include the first/final/median comparison counts as well? It would be helpful for the course.

@dgrcode
Copy link
Collaborator

dgrcode commented Feb 25, 2018

We have separate inputs and outputs, so the input remains with the same type of contents you would find in the course's input. That way the algorithm someone designed for the course should work with these inputs without any change at all.

To find the expected results for each file, you can open the files with the names output_.... For example, to find the expected results for input_dgrcode_01_5.txt, you can read output_dgrcode_01_5.txt.

If your plan is to test your code, I strongly recommend you use the testers in this repo. They can save you a good amount of time. Have a look here: https://github.com/beaunus/stanford-algs/tree/master/tester

@beaunus
Copy link
Owner

beaunus commented Jul 7, 2018

I'm sorry about the delay.

I have updated the relevant README to avoid confusion in the future.

Thank you @dey-dey for bringing this to our attention.

@beaunus beaunus closed this as completed Jul 7, 2018
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

3 participants