All Questions
219
questions
9
votes
3
answers
296
views
Java code to delete all empty folders within a directory
Given the path to a filesystem directory, the task is to delete all empty directories within that root directory. After the process is finished, no empty dir should exist under the root directory (the ...
3
votes
3
answers
144
views
Redouble each occurrence of char recursively, and add n
In following of this question, I would like to have a second review.
The exercise is to write a recursive method that takes a String and a ...
3
votes
1
answer
94
views
Double each occurrence of a char recursively
The exercise is to write a recursive method that takes a String and a char parameter and returns a ...
2
votes
3
answers
543
views
Recursive palindrome check
I'm trying to solve this which basically calls for a recursive palindrome check with some minor extra steps (Special characters and whitespace can be ignored). The test inputs' length can be 100000 ...
2
votes
1
answer
58
views
Merge Sort with Minimum Sufficient Variables, Verbosity and better Space Complexity
The majority of merge sort implementations searched online are provided with unnecessary variables and code lines. Here is an attempt to reduce that. However, does passing back the subArray as return ...
0
votes
1
answer
103
views
Printing Permutations
Following is a leetcode problem:
Given an array nums of distinct integers, return all the possible permutations. You can return all the possible permutations. You can return the answer in any order.
...
0
votes
1
answer
120
views
Given a matrix return true if it contains the Identity matrix (by recursion)
I need to write recursive static method with given 3 parameters
the method will return true if the sub matrix with the size of (int size) which the
left corner is mat[x][x] is the identity matrix
...
1
vote
2
answers
720
views
size() method for a binary search tree
This is my size method for my binary search tree, that is meant to implement recursion to calculate the tree's size.
...
2
votes
1
answer
87
views
Given an array return true if can be splitted to two groups with same number of cells and same sum
Given an array, the method should return true if you can split it to two groups with the same number of cells and so the sum will be equal. It needs to be done by recursion, and can't change the array ...
-3
votes
1
answer
739
views
method to check if number is ascending order by recursion
method name:
public static boolean ascendingNum(int n)
method need to be done by recursion and return if the given number is in ascending order from right to left
<...
3
votes
1
answer
426
views
Pokemon Soul Link tracker
I've just finished writing a program to help track Pokemon across Soul Links. The goal of the program is to take in the names of the two Pokemon alongside the route that they were caught on. The ...
2
votes
1
answer
466
views
Guess Number Game - Console based game using Java
This game is pretty common for beginner projects. I wrote a version of this before all in Main - so here I challenge myself to recreate it in a more OO style.
I wanted to take a more OO approach, so ...
1
vote
3
answers
184
views
Java recursive sort verification function for a linked list
It should return true, if there is no element that follow or the following elements are greater than their predecessors.
...
6
votes
3
answers
2k
views
Money change exam
I was asked to create a method that would:
Return a Change object or null if there was no possible change
The "machine" has unlimited bills of: 2, 5 and 10
The Change object must return the ...
4
votes
3
answers
909
views
Bank Card Generator Code
This program is used to create a random bank card number. Card number is created using account type and client location for the first eight digits and the remaining 8 digits are completely random. I'm ...