03-25-2025 12:36 PM
Is anyone doing this in LabVIEW?
https://www.geeksforgeeks.org/naive-algorithm-for-pattern-searching/
just curious.
Solved! Go to Solution.
03-25-2025 01:45 PM
Use the "Match Pattern" primitive.
03-25-2025 02:26 PM
03-25-2025 03:02 PM - edited 03-25-2025 03:43 PM
i overlooked (n-m) +1 ... 🙈
03-25-2025 09:50 PM
That works! Thank you!
03-26-2025 02:37 PM
I have a couple questions. If LabVIEW is zero indexed, I understand why the last search result is 12. What about 9, the second search result? Shouldn’t the output be 0,8,12 if LabVIEW is zero indexed?
The original GeeksForGeeks example output is: 0,9,13.
03-26-2025 02:41 PM
Maybe there’s a typo in the generated output? The original “calculated” output is 0,9,12.
03-28-2025 10:17 AM
@_Phobos ha scritto:
I have a couple questions. If LabVIEW is zero indexed, I understand why the last search result is 12. What about 9, the second search result? Shouldn’t the output be 0,8,12 if LabVIEW is zero indexed?
The original GeeksForGeeks example output is: 0,9,13.
Your example is also 0-indexed. With the found indices at 0, 9 and 12. Why do you think the second index should be 8?
03-28-2025 10:32 AM
Look further down the page. The Output lists 0, 9, 13. This is not consistent with 0, 9, 12. I think there is a typo in the Output.
03-28-2025 10:38 AM
The 9th element in a zero-indexed sequence would be 8. The 13th element in a zero-indexed sequence would be 12.