Search Interview Questions  More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. 

 
Algorithm  Interview Questions and Answers for 'Sorting algorithm'  6 question(s) found  Order By Newest  
_{}
 
Ans. The sorting algorithm is a modified mergesort. This algorithm offers guaranteed n log(n) performance.  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve java algorithm collections collections.sort sorting algorithm expertCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
Try 1 Question(s) Test  
_{}
 
^{This question was recently asked at 'HeadStrong,ServiceNow'.This question is still unanswered. Can you please provide an answer.}  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve Search Algorithm Sorting Algorithm Asked in 2 Companies basic frequentCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
_{}
 
Ans. https://javasearch.buggybread.com/InterviewQuestions/questionSearch.php?searchOption=label'  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve Algorithm Sorting Algorithm Asked in 4 Companies basic frequentCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
_{}
 
^{This question was recently asked at 'Reddit,ServiceNow'.This question is still unanswered. Can you please provide an answer.}  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve sorting algorithm in place sorting algorithm Asked in 2 CompaniesCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
 
Ans. public class SelectionSort { public static void main(String[] args){ int a[] = {1,3,4,5,7,8,2,6}; for(int i=0;i<a.length;i++){ for(int j=0;j<i;j++){ if(a[j] > a[j]){ int temporary = a[j]; a[j] = a[i]; a[i] = temporary; } } } for(int i=0;i<a.length;i++){ System.out.println(a[i]); } } }  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve sorting algorithm selection sortCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  
 
Ans. public class BubbleSort { public static void main(String[] args){ int a[] = {1,3,4,5,7,8,2,6}; for(int i=0;i<a.length1;i++){ for(int j=i;j<a.length;j++){ if(a[j] < a[j]){ int temporary = a[j]; a[j] = a[i]; a[i] = temporary; } } } for(int i=0;i<a.length;i++){ System.out.println(a[i]); } } }  
Help us improve. Please let us know the company, where you were asked this question :  
_{ Like Discuss Correct / Improve sorting algorithm Bubble sortCorrectionDuplicate of Another QuestionCompany where this question was AskedSuggestion}  