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
NEED HELP easy 10 points WILL HEART
ad-work [718]

Answer: mice is the standard form

5 0
3 years ago
some critics have argued that julius caesar dramatizes the difficulty of balancing private values and public leadership. do you
devlian [24]
I believe that the answer to the question provided above is that for a leader to work effectively one must know how to properly manage them , which is clearly depicted by the theme of the play.
Hope my answer would be a great help for you.    If you have more questions feel free to ask here at Brainly.
4 0
3 years ago
Write a travel diary about a place you visited last year​
Irina18 [472]

Answer:

16th October 2018

10:15 pm

Dear Diary,

Summer is the time to charge up the spirits. The vacations in the summer helps to groom oneself and involve in other activities so as to charge oneself for the coming year. This summer vacation my parents planned to visit Manali. We were very excited to go there. I and my sister started to pack our bags and started to imagine the level of excitement we'll have. We went there by train. The journey on the train was also very exciting. We saw many places through the window and the many things in the train. After reaching we found that the weather of Manali was very cool and soothing. We went to the temples and explored many places. The hotel room was also very beautiful. We stayed there for two days but was the most memorable trip of ours. Also, my mother bought a yak shawl from there. The shawl is very famous and is exclusively found there. We returned back via train. The trip was very exciting and we enjoyed a lot.

         shreya gopakumar

3 0
3 years ago
Read 2 more answers
consider adams own words as excerpted in these highlight and the passage from sewards biography of adams rewrite a portion of th
Dahasolnce [82]
USE EDUBIRSDIE.COM IT WILL HELP U



4 0
3 years ago
Which in-text citation is formatted correctly in MLA style?
Dima020 [189]

The in-text  citation that is formatted correctly  in MLA style is :

Homer writes that Odysseus and his men "were left to groan and wait for morning" (218)

The other ones have incorrect use of citations and bracket.

Good Luck!!

5 0
3 years ago
Read 2 more answers
Other questions:
  • Tim Sullivan, an up-and-coming Finance Manager, is rehearsing a presentation he will give at the company shareholder meeting. Hi
    11·1 answer
  • Imagine you have a career in video game design and are working on a new video game. Write a story about your experience and the
    8·1 answer
  • Give advice for what this group can do to become a more effective group: Your school's Family, Career, and Community Leaders of
    13·1 answer
  • Which statement about signal phrases is true? (5 points)
    14·2 answers
  • Read this assignment.
    7·1 answer
  • An adjective for the root vis/vid
    10·1 answer
  • WILL MARK ANYONE BRAINIEST IF THEY GET THIS ASAP AND CORRECT.
    13·1 answer
  • From the story answer these
    13·2 answers
  • Please select the word from the list that best fits the definition
    14·2 answers
  • To what does the phrase "House on Fire" in the story's title most likely refer?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!