Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

help in developing an algorithm

Status
Not open for further replies.

manu2010

Newbie level 3
Newbie level 3
Joined
Mar 17, 2005
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,311
Please help me with this one:

if s1 and s2 are two strings. we say that we extend s1 if we add a letter at the beginning or at the end of s1, but not in middle.
Ex: if s1=ababc. then both xababc and ababcx extend s1.

i have to design the best algorithm that checks if we can get from s1 to s2 by a sequence of extensions.

thanks
 

If I understand correctly ...
Use your favorite string search function to determine if s1 is a substring of s2. If it is, then s1 can be extended to become s2.

Was that homework?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top