TORONTO KIDS COMPUTER CLUB | Markham Saturday 14:00 Java Homework 21.06.12.
19610
post-template-default,single,single-post,postid-19610,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

Markham Saturday 14:00 Java Homework 21.06.12.

19 Jun Markham Saturday 14:00 Java Homework 21.06.12.

Question:
Input N numbers using scanner and find the Kth Smallest number in the array

Sample Input 1:
10  (Hint: Value of N)
12
22
32
1
23
3
4
5
11
100
5 (Hint: Value of K)

Sample Output 1:
11

(Hint: Sorted order is 1,3,4,5,11,12,22,23,32,100 so the 5th smallest number is 11)

Sample Input 2:
5 (Hint: Value of N)
12
5
2
66
7
3 (Hint: Value of K)

Sample Output 2:
7

(Hint: Sorted order 2,5,7,12,66 so the 3rd smallest  number is 7)
No Comments

Sorry, the comment form is closed at this time.