python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
Math : How many combinations are there with m people and n gifts?
I met a math question. Let's say there are m people and n gifts. A people may receive all n gifts or a (0 <= a < n) gifts or nothing (0 gift). But all the gifts need to gave away. In addition, a...
leo0807
Votes: 0
Answers: 1
Number of valid sequences that satisfies given constraints
The question is to find number of valid sequences (A1,A2....AN) with given constraints:
Value of Ai lies between 1 and 6 (1<= Ai <= 6)
Two adjacent numbers should be coprime. For e.g. 2,4,.. se...
Tarun
Votes: 0
Answers: 4
How to estimate the Time Complexity of generating string Permutations using Recursion tree
The following code prints all permutations of a string:
void permutation(String str) {
permutation(str, "");
}
void permutation(String str, String prefix) {
if (str.length() == ...
Warren Crasta
Votes: 0
Answers: 2
Why does concatenating this string before adding it as a parameter to a recursive function cause stack overflow?
function permToN(charList, returnLen, base) {
if (base.length === returnLen) {
console.log(base)
} else {
for (let char of charList) {
base += char
permToN(charList, returnLen,...
Nora
Votes: 0
Answers: 0