Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
rabin_karp_example.cc File Reference

Illustrative example for Rabin-Karp matching. More...

#include <iostream>
#include <string>
#include <format>
#include <String_Search.H>
Include dependency graph for rabin_karp_example.cc:

Go to the source code of this file.

Functions

int main ()
 Demonstrates Rabin–Karp string search on a sample text and prints match positions.
 

Detailed Description

Illustrative example for Rabin-Karp matching.

Definition in file rabin_karp_example.cc.

Function Documentation

◆ main()

int main ( )

Demonstrates Rabin–Karp string search on a sample text and prints match positions.

Runs a simple example that searches for occurrences of a pattern within a text using Aleph's rabin_karp_search and prints the text, pattern, and the starting indices of each match to standard output.

Returns
int Exit status code: 0 on successful completion.

Definition at line 54 of file rabin_karp_example.cc.

References Aleph::divide_and_conquer_partition_dp(), and Aleph::rabin_karp_search().