1. Given a strings and a dictionary (set of strings) D we want to split s into the substrings $1, S2, ..., Sk such that s; = D for all 1 ≤ i ≤ k. = For example for s = catsanddog and D are (cats, and, dog) and (cat, sand, dog). {cat, cats, and, sand, dog} the two possible splits (a) Design a backtracking algorithm that finds all the possible solutions to the problem that is, all the possible ways to split s into substrings from D. Establish the correctness and analyze the running times of your algorithm. Also comment on the optimality of your algorithm. (b) Modify the algorithm you developed in Question la so that it finds one split of s into substrings from D as efficiently as possible. Establish the correctness and analyze the running times of your algorithm. (c) Design an algorithm that finds efficiently a minimal split that is, a split S1, S2, ..., Sk of s such that s; € D for all 1 ≤ i ≤ k and k is minimal. Establish the correctness and analyze the running times of your algorithm. (d) Design a nondeterministic algorithm that returns TRUE iff s can be split into substrings from D. Establish the correctness and analyze the running times of your algorithm.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please provide me the correct solution.Thanks

1. Given a strings and a dictionary (set of strings) D we want to split s into the substrings $1,
S2, ..., Sk such that s; = D for all 1 ≤ i ≤ k.
=
For example for s = catsanddog and D
are (cats, and, dog) and (cat, sand, dog).
{cat, cats, and, sand, dog} the two possible splits
(a) Design a backtracking algorithm that finds all the possible solutions to the problem that
is, all the possible ways to split s into substrings from D. Establish the correctness and
analyze the running times of your algorithm. Also comment on the optimality of your
algorithm.
(b) Modify the algorithm you developed in Question la so that it finds one split of s into
substrings from D as efficiently as possible. Establish the correctness and analyze the
running times of your algorithm.
(c) Design an algorithm that finds efficiently a minimal split that is, a split S1, S2, ..., Sk of
s such that s; € D for all 1 ≤ i ≤ k and k is minimal. Establish the correctness and
analyze the running times of your algorithm.
(d) Design a nondeterministic algorithm that returns TRUE iff s can be split into substrings
from D. Establish the correctness and analyze the running times of your algorithm.
Transcribed Image Text:1. Given a strings and a dictionary (set of strings) D we want to split s into the substrings $1, S2, ..., Sk such that s; = D for all 1 ≤ i ≤ k. = For example for s = catsanddog and D are (cats, and, dog) and (cat, sand, dog). {cat, cats, and, sand, dog} the two possible splits (a) Design a backtracking algorithm that finds all the possible solutions to the problem that is, all the possible ways to split s into substrings from D. Establish the correctness and analyze the running times of your algorithm. Also comment on the optimality of your algorithm. (b) Modify the algorithm you developed in Question la so that it finds one split of s into substrings from D as efficiently as possible. Establish the correctness and analyze the running times of your algorithm. (c) Design an algorithm that finds efficiently a minimal split that is, a split S1, S2, ..., Sk of s such that s; € D for all 1 ≤ i ≤ k and k is minimal. Establish the correctness and analyze the running times of your algorithm. (d) Design a nondeterministic algorithm that returns TRUE iff s can be split into substrings from D. Establish the correctness and analyze the running times of your algorithm.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education