Skip to main content

All Questions

Tagged with
0 votes
1 answer
165 views

Find a powerset of a set in C

The code below is an implementation of purely recursive solution to find a powerset of any given set. The input set is a string, and the output - array of strings. Both of them are wrapped into a ...
anfauglit's user avatar
  • 103
1 vote
1 answer
133 views

Possible letter combinations of a dial pad in linear time using a recursive approach

Time complexity: I walk the initial unzipped array of keys representing the number O(N) backwards. I then do an inner walk of the proceeding array of letters *O(L^2), mapping it to every value in the ...
Rick's user avatar
  • 586
1 vote
1 answer
3k views

All subsets of a String in java using recursion

I wrote this code for printing all sets of a String. It also prints the empty subset. Is this the right approach ...
Curious's user avatar
  • 13
6 votes
2 answers
2k views

Building a set of all subsets recursively in C++

Here is my recursive implementation of a power set function in C++. One thing that concerns me is that I am iterating over the set of sets while modifying its size. The code nevertheless functions as ...
user11881's user avatar
  • 393
2 votes
2 answers
1k views

A set of names and a request with asterisks

I have a set of names and a request with asterisks. An asterisk can be replaced with any letter. For example, there is a set of names: hasad, ahmed, fizo. And there are a few sample requests: hasad, ...
Maksim Dmitriev's user avatar