• anonymous
Hey, I'm working on ps3c... when I use the prof's function the program is getting caught up on my string search functions. Looks like they are stuck in an infinite loop, but they don't do this when run separately from the prof's function. I'd appreciate any insight from anyone... thanks!! (Also, both have this problem, but I tried iterative and recursive versions of the string searching functions. Here are (1): the searching functions I've written and (2): my ps3c code with the iterative search function implemented.) (1): (2):
MIT 6.00 Intro Computer Science (OCW)
  • chestercat
See more answers at
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this
and thousands of other questions

  • anonymous
length = len(firstMatch) in constrainedMatchPair function seem to be a mistake length should be just length from the input
  • anonymous
Ah, yeah I caught that earlier too, although you don't need to assign it to a variable in the definition - you can just use 'length' in the equation. That wasn't why it was caught in an infinite loop though - that problem was caused because my subStringMatchExact function couldn't handle empty strings, so I put in a condition for that. Take a look / thank so much for answering / I'll repay the favor :)

Looking for something else?

Not the answer you are looking for? Search for more explanations.