Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

i want to try and solve this question..

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Report post to moderator
i need to constract a method which gets the two numbers
"n" and "k"
and prints all the avaible subgroops in "k size"
for example :

subsetofsize(4,2)
prints

12
41
13
32
42
34

i know i should use this recursion of subsets
i need to change it some how
i know how it works but i dont have any clue of how to change it
in order to get the resolt i was asked in the question

 
Bartender
Posts: 9612
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
 
Marshal
Posts: 68976
275
  • Mark post as helpful
  • send pies
  • Report post to moderator
Joe, can I suggest you delete this thread and transfer the original thread from Intermediate over here?
 
alex lotel
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Report post to moderator
you said that i should go to the begginer forum with that question

thats what i did

didnt mean to cause any inconvinience
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic