TORONTO KIDS COMPUTER CLUB | PMCA Sunday 12:00 Java Homework 20.06.21.
17740
post-template-default,single,single-post,postid-17740,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Sunday 12:00 Java Homework 20.06.21.

24 Jun PMCA Sunday 12:00 Java Homework 20.06.21.

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.