Difference: Lab5 (18 vs. 19)

Revision 192017-03-21 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 5 - Pattern Matching

Line: 80 to 80
  bool checkMatch(int a[], int as, int ao, int p[], int ps); // Check to see if the pattern p[] matches in a[] at the location ao
Changed:
<
<
// Precondition: a[] has n integers, p[] has ps integers, ao is an index in A[].
>
>
// Precondition: a[] has as integers, p[] has ps integers, ao is an index in A[].
 // Postcontition: return false if ps is less then as-ao (pattern is longer then elemts left in a[] // Postcontition: return true if the ints in p[] match the ints in a[] starting from ao, else false. // Postcondition: (formally) return ps <= as-ao && a[ao] = p[0] && a[ao+1] = p[1] && .. && a[ao+ps-1] == p[ps-1]
Line: 105 to 105
 
  • Search for 8 9 10
  • Search for 1 2 3 4 5 6 7 8 9 10
Changed:
<
<
  • Search for 1 2 3 4 5 6 7 8 9 10 11
>
>
  • Search for 12
 
  • Search for 5 6 7

Solution

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback