New execution of listpermutations, Computer Engineering

Update the permutation algorithm from the text to obtainthe correct list of permutations even if the string haves repeated letters. For example, if you call ListPermutations on the string "AABB", your program should not generate as many permutations as it does for the string "ABCD" because some of the strings generated by the standard algorithm would be indistinguishable from others. Your program should instead obtain the following six:

AABB

ABAB

ABBA

BAAB

BABA

BBAA

Write a new execution of ListPermutations that works correctly even if the string contains duplicated letters. In writing this execution, you should not merely keep a list of permutations that have already be encountered and avoid generating duplicates. Instead, you should think carefully about the recursive structure of the problem and find a way to avoid generating the duplicates in the first place. You may suppose the string haves only upper case letters from A to Z.

 

Posted Date: 3/16/2013 9:08:10 AM | Location : United States







Related Discussions:- New execution of listpermutations, Assignment Help, Ask Question on New execution of listpermutations, Get Answer, Expert's Help, New execution of listpermutations Discussions

Write discussion on New execution of listpermutations
Your posts are moderated
Related Questions
What are synchronous counters? Design a Mod-5 synchronous counter using J-K Flip-Flops. Ans. Synchronous Counters : It means that all flip-flops are clocked concurrently. T

One cannot use SELECT statements in a report program linked to a Logical Database   False. You can use th SELECT statements.


What is an I/O channel?  An I/O channel is actually a special purpose processor, also known as peripheral processor. The main processor initiates a transfer by passing the need

What are value types and reference types?  Value type - bool, byte, chat, decimal, double, enum, float, int, long, sbyte, short, strut, uint, ulong, ushort. Value types are sto

Business Narrative Aussie Wine Tours (AWT) conduct tours of the wineries of Victoria's Yarra Valley wine region. The tours take place on the last Sunday of each month. Currentl

Explain about the MINI COMPUTER Minicomputers are much smaller in size than mainframe computers and they are also less expensive.  The cost of these computers can differ from a

Differentiate Traditional Commerce verses Electronics Commerce. Identity: Into traditional commerce customers can simply authenticate the identity of a merchant simply throug

Write an applet that sets the background colour to cyan and foreground colour to red and displays a message that illustrates the order in which various applet methods are called wh

Explain chomsky classification of languages with suitable examples Ans: Any language is appropriate for communication provided the syntax & semantic of the language is termed t