Showing posts from June, 2016

Iterative Quick Sort in Java

Problem : - Quick Sort using Iterative approach. Sample code for iterative quick sort : import java.util.Stack ; public class HeapSortIterative { static int [] input2 = { 2 , 23 , 45 , 67 , 5 , 27 , 6 , 7 , 12 , 21 , 67 , …

Sort array of objects using Comparator in python

Problem :- Given an array of  Student objects, sort array using a comparator that sorts them in order of decreasing marks; if  or more students have the same marks, sort those students alphabetically by name. Input :- Array of Student objects(Student…

Python: Using XOR operator find unique elements in array

Problem :- Consider an array of  integers, , where every element in  occurs exactly twice except for one unique element.Find and print the unique element. Input  :-  4 9 95 93 57 4 57 93 9 #Input array with 95 as unique element. Output :- 95 B…

Load More
That is All