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.
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.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 5SA
Related questions
Question
Please provide me the correct solution.Thanks

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

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning

C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning

C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr

Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage

New Perspectives on HTML5, CSS3, and JavaScript
Computer Science
ISBN:
9781305503922
Author:
Patrick M. Carey
Publisher:
Cengage Learning

LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L