...

/

Challenge 2: Finding “k” Smallest Elements in the Array

Challenge 2: Finding “k” Smallest Elements in the Array

Given an array and a number "k," write a function that returns the first "k" smallest elements by using a heap.

Problem statement

Implement a function findKSmallest(int[] arr, int size, int k) ...