Can you help me convert the following recursive code to non-recursive code?

 public void selectCourseHour(List<List<CourseHour>> candidateList, List<CourseHour> selected, List<List<CourseHour>> results, int target) {

        if (CollectionUtils.isEmpty(candidateList)){
            return;
        }

        List<CourseHour> candidate = candidateList.get(0);

        for (CourseHour oneCandidate : candidate){
            if (selected.contains(oneCandidate)) continue;

            List<CourseHour> currentSelected = new ArrayList<>();
            currentSelected.addAll(selected);
            currentSelected.add(oneCandidate);

            if (currentSelected.size() >= target){
                results.add(currentSelected);
            }

            this.selectCourseHour(candidateList.subList(1, candidateList.size()), currentSelected, results, target);
        }

        return;
    }
Dec.24,2021
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3eaf1-2c414.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3eaf1-2c414.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?