subject
Physics, 24.03.2021 18:10 cbogrett

Recall that a palindrome is any string that is exactly the same as its reversal, like I, or DEED, or RACECAR, or . For technical reasons, in this problem, we will only be interested in palindromes that are of length at least one, hence we will not treat the string as a palindrome. Any string can be decomposed into a sequence of palindrome substrings. For example, the string
BUBBASEESABANANA ("Bubba sees a banana.") can be broken into palindromes in the following ways (among many others):
BUB BASEESAB ANANA
B U B B A S E E S A B ANA N A
B U B B A S E E S A B A N A N A
Since any string w can always be decomposed to palindromes we may want to find a de- composition that optimizes some objective. Here are two example objectives. The first objective is to decompose w into the smallest number of palindromes. A second objective is to find a decomposition such that each palindrome in the decomposition has length at least k where k is some given input parameter. Both of these can be cast as special cases of an abstract problem Suppose we are given a function called cost) that takes a positive integer h as input and outputs an integer cost(h). Given a decomposition of w into u1,U2,...,ur (that is, w uUur) we can define the cost of the decomposition as Σί-i cost(w)
For example if we define cost(h) - 1 for all h 2 1 then finding a minimum cost palindromic decomposition of a given string w is the same as finding a decomposition of w with as few palindromes as possible. Suppose we define cost) as follows: cost(h) - 1 for h < k and cost(h)-0 for h 2 k. Then finding a minimum cost palindromic decomposition would enable us to decide whether there is a decomposition in which all palindromes are of length at least k; it is possible iff the minimum cost is 0.
Describe an efficient algorithm that given black box access to a function cost), and a string w outputs the value of a minimum cost palindromic decomposition of w.

ansver
Answers: 2

Another question on Physics

question
Physics, 21.06.2019 17:20
The momentum of an isolated system is conserved a) only in inelastic collisions. b) only in elastic collisions. c) in both elastic and inelastic collisions
Answers: 2
question
Physics, 21.06.2019 22:00
What is the fate of the electrons that interact with a specimen in an electron microscope?
Answers: 1
question
Physics, 22.06.2019 15:40
Question 1 what is amperage? is the rate of doing work. is the rate of flow of protons in electric current. represents the amount of pressure behind electron flow. is the rate of flow of electrons in electric current. 2 points question 2 what is voltage? is the rate of doing power. represents the amount of pressure behind electron flow. is the rate of doing work. is the rate of flow of electrons in electric current. 2 points question 3 what is power? is the rate of flow of protons in electric current. is the rate of flow of electrons in electric current. is the rate of doing work. represents the amount of pressure behind electron flow. 2 points question 4 if we multiply volts times amps we get what? power circuit work current 2 points question 5 what are two ways alternating currents are similiar? in both ac and dc electrons flow in the same pattern. in both ac and dc, the flow of electrons changes directions back and forth. both ac and dc are only possible in certain materials with atoms that will allow electron flow. both ac and dc involve the flow of electrons. 4 points question 6 how does the flow of electrons flow in an alternating current? the flow of electrons is always slower in an alternating current than within a direct current. the flow of electrons is not constant and forward; it changes direction back and forth. electrons flow from from a higher affinity to that of a lower affinity. electron flow is constant and only in a forward direction. 2 points question 7 what is the flow like in a direct current? the flow of electrons is not constant and forward; it changes direction back and forth. the flow of electrons is constant and only in a forward direction. the flow of electrons go from a higher affinity to a lower affinity. the flow of electrons are always faster in a direct current. 2 points question 8 how is an electric current able to flow? electrons flow from the higher affinity to lower affinity and electrical current is generated. protons flow from the higher affinity to lower affinity and electrical current is generated. the movement of protons from one atom to another leads to an electric charge. the movement of electrons from one atom to another atom in a line results in a flow of electric current. 2 points question 9 how do electrons move from the two different types of metal in a battery? protons flow from the metal with the lower affinity to the metal with higher affinity and electrical current is generated. electrons flow from the metal with the lower affinity to the metal with higher affinity and electrical current is generated. electrons flow from the metal with the higher affinity to the metal with lower affinity and electrical current is generated. protons flow from the metal with the higher affinity to the metal with lower affinity and electrical current is generated.
Answers: 2
question
Physics, 22.06.2019 17:00
Sawyer is studying diffraction. he draws a diagram of a plane wave to show how light waves travel. which best describes sawyer’s error? the wave fronts should be perpendicular to the direction in which the waves move. the arrow showing the direction of movement of the waves should be pointing to the left. the arrow showing the direction of movement of the waves should be pointing downward. the wave fronts should be both parallel and perpendicular to the direction in which the waves move.
Answers: 3
You know the right answer?
Recall that a palindrome is any string that is exactly the same as its reversal, like I, or DEED, or...
Questions
question
Social Studies, 22.09.2019 22:30
Questions on the website: 13722367