1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
miskamm [114]
3 years ago
8

Given a non-empty string s and a dictionary containing a list of unique words, design a dynamic programming algorithm to determi

ne if s can be segmented into a space-separated sequence of one or more dictionary words. if s="algorithmdesign" and your dictionary contains "algorithm" and "design". your algorithm should answer yes as s can be segmented as "algorithmdesign

English
1 answer:
nlexa [21]3 years ago
8 0
Let s(i),k denote the substring s(i)s(i+1)...s k. Let Opt(k) denote whether the sub-string s1,k can be segmented using the words in the dictionary, namely (k) =1 if the segmentation is possible and 0 otherwise. A segmentation of this sub-string s1,k is possible if only the last word (say si  k) is in the dictionary theremaining substring s1,i can be segmented. 
Therefore, we have equation:Opt(k) =                    max                       Opt(i)          0<i<k and s(i+1),kis a word in the dictionary
We can begin solving the above recurrence with the initial condition that Opt(0) =1 and then go on to comput eOpt(k) for k= 1, 2. The answer correspond-ing to Opt(n) is the solution and can be computed in Θ(n2) time.

You might be interested in
Last but not least, I wanna thank me
jeka57 [31]

is that a question??????????

7 0
3 years ago
How does the underlined stage direction affect the mood of the scene? The emphasis on the rocker creates a tense mood as everyon
vekshin1

The accentuation on the rocker makes a strained mind-set as everybody is helped to remember where Mrs. Wright smoothly sat as she talked about her dead husband.

<h3>The underlined stage heading</h3>

The underlined stage heading They all check out the rocker influences the state of mind of the scene by adding strain to it.

  • As every one individuals present gander at that rocker, they are helped to remember Mrs. Wright, sitting in that very spot, serenely discussing her dead husband.

  • The manner by which the underlined stage heading influence the mind-set of the scene is:

  • Influences the mind-set of the scene by adding strain to it.

  • This alludes to the coordination of the exhibition of the entertainers in front of an audience while playing out a show to a group of people.

  • In view of this, we can see that from the given text, there is the utilization of stage headings to show that there is a state of mind change which increases the pressure in the stage.

For more information, refer the following link:

brainly.com/question/11176667

6 0
2 years ago
Read 2 more answers
Which of the following types of nonfiction literature is more likely to get an emotional response out of a reader? O poetry pros
Doss [256]

Answer:

i think its poetry, sorry if im wrong :(

Explanation:

7 0
3 years ago
What issue causes conflict between Pepys and his wife
devlian [24]
Well you see Pepy is a loser
8 0
3 years ago
QUESTION 4 OF 10
Nuetrik [128]
Sensitivity to the sound structure of words

It’s the ability to recognize and work with sounds in a spoken language.
8 0
3 years ago
Other questions:
  • Write a paragraph using the following sentences!
    7·1 answer
  • (5) English is a very tricky language loaded with many rules and just as many exceptions to those rules. How does the author's w
    7·2 answers
  • To set off a quote within a quote, you should use A. apostrophes. B. commas. C. regular quotation marks. D. single quotation mar
    14·1 answer
  • Paraphrasing a passage the odyssey
    10·2 answers
  • Which poetic device did 14th century poets rely upon to make their verses easy to memorize?
    13·2 answers
  • The contrast between what is said and what is meant is called..
    9·1 answer
  • What did the ancient Greeks think about the world?
    15·1 answer
  • What are two quotes from Night by Elie Wiesel and what do they mean?<br>chapters 1 and 2
    6·1 answer
  • . Clean the room,.....? (Tag) ​
    9·2 answers
  • Can someone plz help me I’m begging! :(
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!