,
Martín Farach-Colton
,
Inge Li Gørtz
,
Ivor van der Hoog
Creative Commons Attribution 4.0 International license
We revisit the classic game of Snake and ask the basic data structural question: how many bits does it take to represent the state of a snake game so that it can be updated in constant time? Our main result is a data structure that uses optimal space (within constant factors). To achieve our results, we introduce several interesting data structural techniques, including a decomposition technique for the problem, a tabulation scheme for encoding small subproblems, and a dynamic memory allocation scheme.
@InProceedings{bille_et_al:LIPIcs.FUN.2024.3,
author = {Bille, Philip and Farach-Colton, Mart{\'\i}n and G{\o}rtz, Inge Li and van der Hoog, Ivor},
title = {{Snake in Optimal Space and Time}},
booktitle = {12th International Conference on Fun with Algorithms (FUN 2024)},
pages = {3:1--3:15},
series = {Leibniz International Proceedings in Informatics (LIPIcs)},
ISBN = {978-3-95977-314-0},
ISSN = {1868-8969},
year = {2024},
volume = {291},
editor = {Broder, Andrei Z. and Tamir, Tami},
publisher = {Schloss Dagstuhl -- Leibniz-Zentrum f{\"u}r Informatik},
address = {Dagstuhl, Germany},
URL = {https://drops.dagstuhl.de/entities/document/10.4230/LIPIcs.FUN.2024.3},
URN = {urn:nbn:de:0030-drops-199118},
doi = {10.4230/LIPIcs.FUN.2024.3},
annote = {Keywords: Data structure, Snake, Nokia, String Algorithms}
}