Difficult recursion problem in C

  • Thread starter Thread starter dan.b
  • Start date Start date
  • Tags Tags
    Recursion
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
5 replies · 4K views
dan.b
Messages
2
Reaction score
0
Hi, everybody.
I really need your help with this question that giving me no sleep at nights. :( no loops and no pointers, and No STATIC can be used.
Write a recursive function that fills the given character
array with all possible given-size subsets of characters in
given word, separated by commas

does anyone have an idea?
 
Last edited:
Physics news on Phys.org
it means no using *types, calling to r as an address in the array is fine.
what is first recursion technique can you add an exmple?
 
The subsets of size m of the numbers 1,2,...n are:
1, added at the beginning of the subsets of size m-1 of the numbers 2,3,...,n
followed by the subsets of size m of 2,...,n
This doesn't consider the base cases--base cases are when m=0, or when the range of numbers considered is empty.
 
Last edited:
Alright, I'll delete the second part.