J
jkelt46
Hi,
Let me start off with I am not looking for someone to just post code
to solve my problem; I only want some hints.
I just started my second C programming course. My first assignment is
to create a program that takes a variable length string as input and
prints out combinations of the string without repeating characters.
The assignment I was given is:
You are given the string of cat. Create a program that outputs the
following:
cat
cta
act
atc
tca
tac
When you are testing this program the number of strings that the
program generates will be strlen(input)!. i.e. 3! = 3x2x1 = 6
What is the name of this type of program? I searched on string
factorial but the only results seem to permutation generators where
the results are 3x3x3=27 for my example. If I knew the proper term
for what I am trying to do I might be able to figure this out. Am I
trying to write a program that does combinations, factorials, or
permutations?
Thank you,
Let me start off with I am not looking for someone to just post code
to solve my problem; I only want some hints.
I just started my second C programming course. My first assignment is
to create a program that takes a variable length string as input and
prints out combinations of the string without repeating characters.
The assignment I was given is:
You are given the string of cat. Create a program that outputs the
following:
cat
cta
act
atc
tca
tac
When you are testing this program the number of strings that the
program generates will be strlen(input)!. i.e. 3! = 3x2x1 = 6
What is the name of this type of program? I searched on string
factorial but the only results seem to permutation generators where
the results are 3x3x3=27 for my example. If I knew the proper term
for what I am trying to do I might be able to figure this out. Am I
trying to write a program that does combinations, factorials, or
permutations?
Thank you,