Given a sorted array A containing N integers both positive and negative. You need to create another array containing the squares of all the elements in A and return it in non-decreasing order. Try to ...
Here, I am writing the code for sorting JSONArray in java technology. we can sort jsonarray in ascending or in descending order according to our requirement by changing pattern as below. private ...
Given a string, sort it in decreasing order based on the frequency of characters. 'e' appears twice while 'r' and 't' both appear once. So 'e' must appear before both 'r' and 't'. Therefore "eetr" is ...