Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
5 votes
3 answers
719 views

A simple checksum for java.math.BigInteger

Intro I have a simple methods that converts the input instances of java.math.BigInteger to checksum. The checksum algorithm sums up all the digits in the input <...
coderodde's user avatar
  • 31k
5 votes
3 answers
996 views

LeetCode 678: Valid Parenthesis String, Recursion memoization to DP

How can the following recursion + memoization code be converted into a tabulation format dynamic programming solution? The code is working, but I want to improve it. The challenge I am facing is ...
Elias El hachem's user avatar
5 votes
2 answers
136 views

Check whether two Strings are anagrams of each other - then print all anagrams

I should write a CLI through which two Strings can be read in. These two Strings should be checked for whether they are anagrams of each other For both Strings, I should give out all their possible ...
Andrew Bailey's user avatar
9 votes
3 answers
359 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 ...
user avatar
4 votes
3 answers
180 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 ...
Tobias Grothe's user avatar
3 votes
1 answer
103 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 ...
Tobias Grothe's user avatar
2 votes
3 answers
559 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 ...
Yamin Siahmargooei's user avatar
2 votes
1 answer
72 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 ...
Thomas Mathew's user avatar
0 votes
1 answer
107 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. ...
Strange Alchemist's user avatar
0 votes
1 answer
129 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 ...
anton5450's user avatar
1 vote
2 answers
735 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. ...
Rasmus Steen's user avatar
2 votes
1 answer
97 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 ...
anton5450's user avatar
-2 votes
1 answer
756 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 <...
user252016's user avatar
3 votes
1 answer
445 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 ...
Temps's user avatar
  • 49
2 votes
1 answer
483 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 ...
Arquile's user avatar
  • 21

15 30 50 per page
1
2 3 4 5
15