Design Secrete key generation program or Algorithm
-
<pre lang="C#">
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.Sample Input: Sample Output:
X 12
YXYX 21435
YYXYYXXY 321654798
</pre> -
<pre lang="C#">
Adam works in the in networking security cell. He wants to generate secret keys
following a pattern. The pattern consists of the characters X and Y.
where X means increasing and Y means decreasing. Help him devise an
algorithm to generate the secret key which is the minimum number encoded
following that pattern. Digits from 1-9 and digits can’t repeat.Sample Input: Sample Output:
X 12
YXYX 21435
YYXYYXXY 321654798
</pre>Your homework should serve the purpose that you learn something. And that something isn't supposed to be how to get other people to doing your homework for you. Your assignments will get more difficult over time - so if you don't start doing them yourself now you'll never be able to. So sit down, think about it and try something. If you then encounter a specific problem, feel free to ask - that's the idea of these forums.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson