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 is a binary tree? A binary tree 'T' is described as A finite set of elements, known as nodes, such that: either (i) or (ii) happens: (i) T is empty (known as the 'nu

Convert the given S-R flipflop to a D-flip flop. Ans: The Truth Table for S-R Flip-Flop is illustrated in Fig.(a) and truth table of D Flip-Flop is illustrated in Fig.(b)

Data validation is a significant concept in VBA. Application process and a custom dialog box can be used to accurate input errors. You can assign an application process to the fram

File History.d1 contains a brief history of computing. There are no indentations in this file. Write a program to read this file, inserting five blank spaces at the beginning of ea

What is the draw back of assigning one bit position to each control signals? Assigning individual bits to every control signal results in long microinstructions due to the numb

How putchar function is used within a C Program ? The following program reads each character in the first line of input entered at the terminal's keyboard. It uses putchar to d

Data is to be transmitted using a modem at 9600 bps. Determine the minimum bandwidth of the system with the following modulation methods (a) FSK (b) ASK. Use the excess bandwidth f

Classification Of Parallel Computers  Introduction Parallel computers are those that underline the parallel processing among the operations in some way. In the last unit,

Explain Elimination of common sub expression during code optimization An optimizing transformation is a regulation for rewriting a segment of a program to enhance its execution

Q. Explain about Hyper-threading? Non threaded program instructions are executed in a single order at a time until the program completion. Presume a program have four tasks nam