Win a copy of Head First Go this week in the Go forum!

D.J. Quavern

Ranch Hand
+ Follow
since Feb 19, 2019
D.J. likes ...
Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
5
Total given
31
Given in last 30 days
18
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt Green check

Recent posts by D.J. Quavern

Hello again!

I don't get how map get information about the array. In this code, there is no connection between the two data structures.

1 week ago
Go
Good morning Rangers!

I read this blog post https://medium.com/@kasunsiyambalapitiya/implementation-of-the-exercise-slices-in-a-tour-of-go-938daa5205bf and I do not understand when do the variables corresponding to x and y are passed to the function. I feel really lost.

I tried to pass arguments in the main

and of course I got some uncomprehensible go error.


1 week ago
Go
Thank you a lot. I get it now!
1 week ago

Stephan van Hulst wrote:
Because mergesort is a stable sorting algorithm it is guaranteed that after sorting the array, aliceOne must come before aliceTwo, and therefore changing the name of aliceOne will result in [Eve, Alice, Bob, Carol, Dave]. With quicksort you don't have this guarantee, so it's not used for arrays of objects.



You write that I don't have this guarantee, but it's still possible?
1 week ago

Stephan van Hulst wrote:

D.J. Quavern wrote:If aliceOne is in the right position in the array


What's the right position of aliceOne in the array after sorting?



I would have said first but I suspect that I am supposed -since you are asking- to reply second since quicksort works with swaps?
1 week ago
Thank you!
Even though it was very clear, I don't get why you did not have this garantee for quicksort? If aliceOne is in the right position in the array, the name should be changed easily to Eve even with quicksort?
1 week ago

Campbell Ritchie wrote:

Michael Krimgen wrote:Java uses TimSort for Objects: . . .

I presume you know why? That is the same as the modified merge sort Stephan mentioned.



No, I don't know anything except the the information from Wikipedia. Is there a special reason except it's more efficient?
1 week ago
Thank you everybody, that was a lot of threads to follow to make a better report
1 week ago
Dear ranchers,

I am writing a report on java quicksort and comparing it to mine. I have to come with explanations about which ameliorations makes java quicksort so performant against a home made version.

I tried to read the source code which is thousands rows long and could not find obvious ameliorations: I wrote about:
- insertion sort threeshold (47), the merge sort threeshold (286);
- that java had been using empirical tests to choose a pivot (explanations at row 296)
- that java uses pair insertion sort.

What else do you recommend I should be mentioning in my report? I don't really know what makes a difference in performance.
2 weeks ago
Sorry! "Two lines", not "to lines". Damn my brain!
2 weeks ago
A short, not a shirt. Damn autocorrect!
2 weeks ago
Hi Tim!
The master theorem is just a shirt theorem about time complexity. (I add a picture of what I want to include in my paper) I use it to prove that time complexity for quicksort is n log n.
I want to write to lines within curly brackets, but even when I escape it it does not work.
2 weeks ago

Tim Moores wrote:What software are you using? There are numerous markdown syntaxes and implementations around, so you need to ensure that the software you're using supports the markdown features you're using.


I'm using visual code.
2 weeks ago
Hello,
I am not sure where I should put this question. I am trying to write the master theorem in markdown (which requires a double curly bracket as you all remember but it just does not work.  I tried using syntax from LaTex, or


I used this guide but it does not work:http://www.stat.cmu.edu/~cshalizi/rmarkdown/#math-in-r-markdown

Even the footnotes system I found on internet does not work





Can somebody help me out with my curly bracket and footnote?
Thanks a lot!

2 weeks ago

Stephan van Hulst wrote:It wasn't, and I would have made the method static as well, because it's not using instance fields.



Can I give you a cow, or nominate you for a cow ?
I was really unable to figure out the issue before you pointed out the pivotOne and pivotTwo dynamics!
2 weeks ago