New execution of listpermutations, Computer Engineering

Assignment Help:

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.

 


Related Discussions:- New execution of listpermutations

How to increase simulation speed, How to increase simulation speed     ...

How to increase simulation speed     First figure out what is eating away your CPU cycles. Is it 1. Compile time - Use a Make file to compile only files with changes and not

State about an active graphics device, State about An active graphics devic...

State about An active graphics device An active graphics device allows the user to communicate with the computer graphically. Generally, this implies that the user is supplyin

Show the properties of text box, Q. Show the properties of Text Box? Th...

Q. Show the properties of Text Box? The tag is used to specify where user input is expected. It has several attributes, of which TYPE attribute is used to specify th

Circles in the visualization, To sktech the circles in the visualization, y...

To sktech the circles in the visualization, you need to use the paramteric equation of a circle (x = r cos (Θ), y = r sin(Θ). A circle can be shown as a polygon where the points of

Grid computing, Grid Computing means applying the resources of a lot of com...

Grid Computing means applying the resources of a lot of computers in a network simultaneously to a one problem for solving a scientific or a technical problem that needs a large nu

Explain the working of dynamic ram - computer memory, Explain the working o...

Explain the working of Dynamic RAM? A plain piece of hardware called a DRAM controller can be used to make DRAM behave more like SRAM and the job of the DRAM controller is to p

Flynns categorization, Flynn's Categorization Flynn's Categorization is...

Flynn's Categorization Flynn's Categorization is based on multiplicity of data streams and instruction streams observed by CPU at the time of program execution. Let I s and D

Why does dma have priority over the cpu, Why does DMA have priority over th...

Why does DMA have priority over the CPU when both request a memory transfer? The data transfer monitored by DMA controller which is called as DMA channel. The CPU is included o

State about the firewalls - intranet, Firewalls While getting one fire...

Firewalls While getting one firewall for the company's Intranet it should be well known that firewalls come in both hardware and software forms, and that even though all firew

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd