1 / 7

Lua Hash Tables for Efficient Data Searching

Understand Lua hash tables as a data structure for efficient key-based searches. Learn about collision handling and the dynamic associative array structure. Lua's data types and syntax are inspired by Pascal and implemented in C.

mary
Télécharger la présentation

Lua Hash Tables for Efficient Data Searching

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hashovací tabulky v Lua Petr Vévoda

  2. Hashovací tabulka • vyhledávací datová struktura, • vyhledávání pomocí klíčů, spočtených z hashovací funkce, • funkce může vracet pro různá data stejný klíč – vznikají kolize.

  3. Programovací jazyk Lua • skriptovací jazyk s dynamicky typovanými proměnnými, automatickou správou paměti, … • syntaxe inspirovaná Pascalem, • napsaná v jazyku C, • zdrojový text =>bajtkód=> interpret.

  4. Datové typy • Lua má 8 datových typů: nil, boolean, number, string, userdata,function, thread, table. • Všechny pokročilejší datové struktury jako pole, seznamy, záznamy jsou reprezentovány pomocí typu table.

  5. Datový typ tabulka • Ve formě dynamického asociativního pole (klíč => hodnota). • Klíč může být jakéhokoliv datového typu (další tabulka, funkce, řetězce), hodnoty tabulky můžou být odlišných typů. • Při přístupu na neexistující index vrací tabulka hodnotu nil. • Mazání probíhá přiřazením hodnoty nil (proběhne GarbageCollect)

  6. Zdroje • Lua 5.2 Reference Manual.  [online]. 2011. URL: http://www.lua.org/manual/5.2/. • HUDEC, B. Programovací techniky. 4. vyd. Praha: Vydavatelství ČVUT, 2001. 234 s. ISBN 80-01-02374-5. • Ierusalimschy, R. Programming in Lua. 3. vyd. Vydavatelství Lua.org, 2013. 367 s. ISBN 85-90-37985-X

More Related