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
Functioning of ROLAP happens concurrently with relational databases. Data and tables are stored as relational tables. To hold new information or data new tables are formed. Functio

different types of buses with diagram

Determine about the raster-scan systems Most of the present raster-scan systems contain a separate processor called as display processor. This processor performs graphics func

list out of merit and de-merit plasma display

What format should my database be saved in to allow different versions of Microsoft Access to open the database? Ans) MS Access is not backwards compatible. To share tables amon

Q Develop a program that accepts decimal number and converts it into given base. Fractional numbers are allowed and negative numbers are not allowed. Also check that entered number

S oftware Engineering - Layered Technology Although various authors have developed personal definitions of software engineering, a definition given by Fritz Bauer at the semin

Explain clearly the four stages in the Rapid Application Development

Write short note on Quantization. Quantization: This is the first step in PCM. The whole amplitude range of the modulating signal is divided in a number of standard levels term

What is Fork swap? "Fork ()" is a system call to make a child process. When the parent process calls "fork()" system call, the child process is formed and if there is short of