How to get started on a assignment that performs fast string matching

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sunilr245
    New Member
    • Oct 2013
    • 16

    How to get started on a assignment that performs fast string matching

    i have to write a function
    int find string(char *s, char *t)
    that finds the first place at which the string t occurs as substring of the string s, and
    returns that position, if one exists, counting from 0, and -1 if none exists.
    E.g., for s=
    “example” and t=“ample” the program should return 2, for the same s and t=“exam”
    the program should return 0, and for t=“error” it should return -1. The strings s and t
    are \0-terminated strings.

    Im having trouble getting started with this assignment. i was just wondering how to go about starting this assignment, ive tried some things but it seems what i was doing in the first place was wrong, i need to start fresh and i would like a push in the right direction
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    I will suggest you to at least sort out how would you do it by yourself as a human being not as a computer

    Comment

    Working...