This repository has been archived on 2022-06-22. You can view files and clone it, but cannot push or open issues or pull requests.
usaco-guide/content/6_Plat/Suffix_Array.mdx
2020-06-27 23:56:39 -04:00

77 lines
2 KiB
Text

---
id: suffix-array
title: "Suffix Array"
author: Benjamin Qi
description: "Quickly Sorting Suffixes of a String (and Applications)"
prerequisites:
- Gold - Hashing
frequency: 1
---
import { Problem } from "../models";
export const metadata = {
problems: {
sample: [
new Problem("YS", "Suffix Array", "suffixarray", "Easy", false, [], ""),
],
lcpSam: [
new Problem("YS", "# of Substrings", "number_of_substrings", "Easy", false, [], ""),
],
lcp: [
new Problem("Plat", "Standing Out from the Herd", "768", "Normal", false, [], ""),
new Problem("CF", "Two Prefixes", "contest/1090/problem/J", "Hard", false, [], ""),
],
burSam: [
new Problem("CSES", "String Transform", "1113", "Easy", false, [], ""),
],
runSam: [
new Problem("YS", "Run Enumerate", "runenumerate", "Hard", false, [], ""),
]
}
};
<resources>
<resource source="CF" title="Suffix Array" url="edu/course/2/lesson/2" starred>Videos & Practice Problems</resource>
<resource source="cp-algo" title="Suffix Array - Definition & Construction" url="suffix-array.html" starred></resource>
<resource source="CPC" title="11 - Strings (Suffix Array)" url="11_strings"></resource>
</resources>
## Suffix Array
<problems-list problems={metadata.problems.sample} />
(recommend that you also test against brute force for many small strings)
(impl)
## LCP Array
<problems-list problems={metadata.problems.lcpSam} />
Quickly compute longest common prefix of two suffixes.
(impl)
<problems-list problems={metadata.problems.lcp} />
## Inverse Burrows-Wheeler
<resources>
<resource source="GFG" title="Inverting Burrows-Wheeler Transform" url="inverting-burrows-wheeler-transform">could be simpler?</resource>
</resources>
CSES Guide?
<problems-list problems={metadata.problems.burSam} />
## Run Enumerate
<resources>
<resource source="cp-algo" title="Finding repetitions" url="main_lorentz.html">could be simpler?</resource>
</resources>
(describe how to do easily w/ suffix array)
<problems-list problems={metadata.problems.runSam} />