Interviewer And Interviewee Guide

Sort And Searching Interview Question:

Do you know why doesn't the Java library use a randomized version of quicksort?

Submitted by: Muhammad
At the very least, the library should cutoff to some guaranteed N log N algorithm if it "realizes" it is in trouble. Perhaps to avoid side effects. Programmers may want their libraries to be deterministic for debugging. But the library only uses quicksort for primitive types when stability is not an issue, so the programmer probably wouldn't notice the randomness, except in running time.
Submitted by: Muhammad

Read Online Sort And Searching Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.