TORONTO KIDS COMPUTER CLUB | Aurora Thursday Java 18:00 – 06.17
19602
post-template-default,single,single-post,postid-19602,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.8.0,vc_responsive

Aurora Thursday Java 18:00 – 06.17

18 Jun Aurora Thursday Java 18:00 – 06.17

Question 1

Given an array of strings as below:

strArr = ["apple","banana","or","and","they","them","fighter"]

Use any sorting algorithm to sort the array according to the size of the string. If the array contains multiple strings with the same length, you can order those strings in any order.

Final Sorted array should be as below

strArr = ["or","and","they","them","apple","banana","fighter"]

Question 2

Modify the code that we have written for merge sort, change the code so that the array is sorted in descending order (from the biggest number to the smallest number) instead of ascending order(smallest to biggest number).

If you do not have the code for the merge sort, you can find the link to the code as below:

https://paste.ubuntu.com/p/f5CCJwQ7jN/

No Comments

Sorry, the comment form is closed at this time.