Skip to main content

All Questions

Tagged with
9 votes
3 answers
601 views

Form all possible well-formed strings of 'n' nested pairs of 2 types of ASCII brackets

Taking an interest in the challenge presented in this recent Code Review question, I've concocted a C solution (valid as C++, if I'm not mistaken) seeking to reduce both the lines of code and the ...
Fe2O3's user avatar
  • 4,657
1 vote
2 answers
259 views

Recursive Matrix Multiplication Algorithm

Can I improve on this any further. Is there a prettier way of passing the array sizes? ...
Ivor Denham-Dyson's user avatar
3 votes
3 answers
386 views

Find k-distinct partitions which contain at least two perfect squares

Problem Statement: A k-distinct-partition of a number \$n\$ is a set of \$k\$ distinct positive integers that add up to \$n\$. For example, the 3-distinct partitions of 10 are \$1+2+7\$ \$1+...
Phoenix's user avatar
  • 387
2 votes
2 answers
775 views

Find subsets of size K in N set

The question is: There is a set An, and it consists of integers from 1 to n. ...
Roy Yoon's user avatar
3 votes
3 answers
2k views

Tower Hopper problem recursive approach

The Tower Hopper problem gives us an array of values representing heights that express how far we can jump from a certain tower, and asks whether there's a way to get from ...
jeremy radcliff's user avatar
2 votes
1 answer
146 views

trying out possible combinations of varying formula with recursion

I wrote a program in c what looks for integer solutions of different formulas. The program asks the user for a dimension which defines the formula. For example, the formula of the third dimension has ...
Aemyl's user avatar
  • 840
3 votes
1 answer
1k views

A recursive function that performs a binary search

I created a recursive function that uses binary search to just return true if it finds the value and false if it does not. I'm new to recursion and binary search so please let me know where I can ...
Joseph Palomino's user avatar
12 votes
4 answers
11k views

Calculating longest increasing sub-sequence recursively

I have trouble understanding recursion, so I'm trying to implement algorithms using it. I wrote this code that calculates the length of the longest increasing sub-sequence. How can I improve this? <...
user270386's user avatar
1 vote
2 answers
2k views

Finding difference between adjacent integers in an array - recursive Implementation

I'm trying to do a recursive implementation of the problem mentioned below. The code works, and takes care of a corner case with only 1 element in array (in which case I should return ...
coderb's user avatar
  • 165
2 votes
3 answers
728 views

To check if a string C is an interleaving of A and B Code

This is my code to check if a string C is an interleaving of Strings A and B. Please suggests optimizations, and where I can improve. ...
amiageek's user avatar