1. Engineering
  2. Computer Science
  3. given a string of characters s1s2 sn...

Question: given a string of characters s1s2 sn...

Question details

Given a string of characters s1s2 . . . sn. It is believed that the string is English sentences in which all spaces and punctuations have been removed. The following methods can be used to insert spaces back into the document.

(a) Constructed a graph from the string s1s2 . . . sn and then find a path in the graph.

(b) Solve the problem by dynamic programming.(sub problem , pseudo C code )

Use the following string wewillmeetatmidnight to explain the above two methods. You may assume that the only words are

a at me meet mid midnight night we will

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution