A Straight-Line Program (SLP) for a string is a context-free grammar (CFG) that derives only, which can be considered as a compressed representation of . In this paper, we show how to encode in bits to support random access queries of extracting in worst-case time, where is the length of , is the alphabet size, is the number of variables in and is the number of symmetric centroid paths in the DAG representation for . The time complexity is almost optimal because Verbin and Yu [CPM 2013] proved that term cannot be significantly improved in general with -space data structures. We also present alternative encodings that achieve the same random access time with or bits of space.

生成讲解博客的中文版本

生成AI智能校验的中文版本