Diff for ''
| Deletions are marked like this. | Additions are marked like this. |
| Line 1: | Line 1: |
| Místa, kam si může matfyzák zajít zapařit, nebo třeba jen poslechnout roztodivné druhy hudby. * [http://www.novasin.cz Klub Galerie Nová síň] ** Voršilská 3, Praha 1 (kousek od Národního divadla) * [http://www.crossclub.cz/ Cross Club] – Kolejím 17. listopadu nejbližší zařízení - stačí přeběhnout most. Velice působivá výzdoba. ** Plynární 23, Praha 7 ** Drum'n'bass, techno, reggae, dub, občas i jiné * [http://www.mecca.cz/ Mecca] – Klub stále ještě dosažitelný pěšky i v pokročilém stavu. Mírně snobský ale stylový podnik. Hip-hop akce jsou přeplněny slečnami, které ještě nemají dle zákona pít (přesto tak činí), z důvodu volného vstupu (pro slečny). Housové akce bývají lepší. ** U Průhonu 3, Praha 7 ** Hip-hop, R'n'b, komerčnějsí house (deep house, vocal house) * [http://www.musicbar.cz/ Lucerna Music Bar / Futurum Music Bar] – V pátek a sobotu 80' & 90' video diskotéka DJ Jirky NEUMANNA. Věkové obsazení 20+ (pozor, občas velký rozptyl). Doporučuji aspoň jednou navštívit - stojí to za to. ** Vodičkova 36, Praha 1 ** Zborovská 7, Praha 5 ** Discooooo!!! * [http://www.bukanyr.cz/ House Boat Bukanýr] – Chrám všech vyznavačů progressive a electro house. Velice příjemné, komorní prostředí. Návštěvnící sem chodí pouze za hudbou, a vědí, proč tam jdou. V létě otevřeno i 1. patro lodi s fotbálky a dalším barem. Občas se i griluje ** Hořejší nábřeží, pod Palackého mostem, nedaleko botelu Admirál - pozor, loď se občas přemístí, dle aktuální stížnosti na hluk od obyvatel ** Progressive, electro house * [http://www.malyglen.cz/ U Malého Glena] – Zapadlý bar zhruba 100m od Malostranského náměstí, patřící mezi to nejlepší, co Praha může ohledně Jazzu a Bluesu nabídnout. Denně živé koncerty ve velice komorním prostředí (pro max. 30 - 40 osob). Cena za jeden večer 150 Kč. Pití standartně zvýšená cena. ** Karmelitska 23, Praha 1 ** Jazz, Blues * [http://www.leclan.cz/ Le Clan] – Private club otevírající v 10 hodin večer, vhodný k dojezdům. Lze poslouchat DJ, poležet si v křesílkách (spící osoby se nebudí), zahrát šipky či ping-pong, nebo dělat cokoliv v Dark roomu (např. se nechat ukřižovat). ** Balbínova 23, Praha 2 ** House, Lounge, Downtempo * [http://klub.roxy.cz/ Roxy] – Základna všech pražských clubberů. Multikulturní zařízení s výtečnými Free Mondays a ještě lepšími pátky a sobotami. Nedávno proveden upgrade soundsystému na jeden z nejkvalitnějších v Praze. ** Dlouhá 33, Praha 1 ** Vše možné, house, techno, hip-hop ... * [http://www.studio54.cz/ Studio 54] – Další after-party klub. DJs začínají hrát v 5 ráno a končí hodinu po poledni. Pokud se chcete pořádně zmastit, Studio 54 je vaše destinace. P.S.: Návštěvníci opravdu drogy neberou. ** Hybernská 38, Praha 1 ** Techno, House, Progressive * [http://www.duplex.cz/ Duplex] – Chcete pít pivo za 80 Kč? Chcete si dát flašku vína za 500 Kč? Chcete vidět rádobycelebrity a být druhý den v novinách? Chcete vědět, jak se dá prznit taneční hudba na sto způsobů a jak rozhodně nevypadá dobrý vkus? Zajděte si do Duplexu. Aspoň jednou za život. ** Václavské náměstí 21, Praha 1 ** Lucaso a Uwa se pokoušejí o "minimálek", jinak house |
# **NTIN066** Datové struktury I: Úkoly 2024 ## 1. `tree_successor` Given an implementation of a simple binary search tree including parent pointers, implement a `successor` method. The methods is given a node and it should return another node of the tree with the next higher key (i.e., the smallest of keys which are greater than the given one). - If there is no such node, it should return a null pointer. - The given node can also be a null pointer, in which case the method should return the smallest node in the tree. You can expect that `successor` method is never called on an empty tree. You should submit the file `tree_successor.*` (but not the `tree_successor_test.*`). Source code templates can be found in [the git repository](https://gitlab.kam.mff.cuni.cz/datovky/assignments/-/tree/master). ## 2. `splay_operation` Given an implementation of a binary search tree including parent pointers: - implement `splay` method, preferably utilizing the provided `rotate` operation performing a single rotation; - update `lookup`, `insert` and `remove` methods to utilize it correctly. You can implement the `remove` operation in more ways. However, if it is not the one presented in the lecture, you should provide a reference to the proof that it has the right amortized efficiency (e.g., a reference to a standard textbook). You should submit the `splay_operation.*` file (but not the `splay_operation_test.*`). Source code templates can be found in [the git repository](https://gitlab.kam.mff.cuni.cz/datovky/assignments/-/tree/master). Files splay_operation_more_tests.{cpp,py} contain additional tests for bugs discovered in students' solutions during this semester. They are not included on recodex, but your program should pass them in few seconds. ## 3. `Goal` The goal of this assignment is to evaluate your implementation of Splay trees experimentally and to compare it with a "naive" implementation which splays using single rotations only. You are given a test program (`splay_experiment`) which calls your implementation from the previous assignment to perform the following experiments: - _Sequential test:_ Insert _n_ elements sequentially and then repeatedly find them all in sequential order. - _Random test:_ Insert _n_ elements in random order and then find _5n_ random elements. - _Subset test:_ Insert a sequence of _n_ elements, which contains arithmetic progressions interspersed with random elements. Then repeatedly access a small subset of these elements in random order. Try this with subsets of different cardinalities. The program tries each experiment with different values of _n_. In each try, it prints the average number of rotations per splay operation. You should perform these experiments and write a report, which contains the following plots of the measured data. Each plot should show the dependence of the average number of rotations on the set size _n_. - The sequential test: one curve for the standard implementation, one for the naive one. - The random test: one curve for the standard implementation, one for the naive one. - The subset test: three curves for the standard implementation with different sizes of the subset, three for the naive implementation with the same sizes. The report should discuss the experimental results and try to explain the observed behavior using theory from the lectures. (If you want, you can carry out further experiments to gain better understanding of the data structure and include these in the report. This is strictly optional.) You should submit a PDF file with the report (and no source code). You will get 1 temporary point upon submission if the file is syntantically correct; proper points will be assigned later. ### Test program The test program is given three arguments: - The name of the test (`sequential`, `random`, `subset`). - The random seed: you should use the last 2 digits of your student ID (you can find it in the Study Information System – just click on the Personal data icon). Please include the random seed in your report. - The implementation to test (`std` or `naive`). The output of the program contains one line per experiment, which consists of: - For the sequential and random test: the set size and the average number of rotations. - For the subset test: the subset size, the set size, and the average number of rotations per find. The initial insertions of the full set are not counted. ### Your implementation Please use your implementation from the previous exercise. Methods `splay()` and `rotate()` will be augmented by the test program. If you are performing a double rotation directly instead of composing it from single rotations, you need to adjust the `BenchmarkingTree` class accordingly. ### Hints The following tools can be useful for producing nice plots: - [pandas](https://pandas.pydata.org/) - [matplotlib](https://matplotlib.org/) - [gnuplot](http://www.gnuplot.info/) A quick checklist for plots: - Is there a caption explaining what is plotted? - Are the axes clearly labelled? Do they have value ranges and units? - Have you mentioned that this axis has logarithmic scale? (Logarithmic graphs are more fitting in some cases, but you should tell.) - Is it clear which curve means what? - Is it clear what are the measured points and what is an interpolated curve between them? - Are there any overlaps? (E.g., the most interesting part of the curve hidden underneath a label?) In your discussion, please distinguish the following kinds of claims. It should be always clear which is which: - Experimental results (i.e., the raw data you obtained from the experiments) - Theoretical facts (i.e., claims we have proved mathematically) - Your hypotheses (e.g., when you claim that the graph looks like something is true, but you are not able to prove rigorously that it always holds) Source code templates can be found in [git](https://gitlab.kam.mff.cuni.cz/datovky/assignments/-/tree/master). ## 4. `ab tree` You are given a representation of _(a, b)-tree_ with a `find` operation, and a representation of an _(a, b)-tree node_. Your goal is to implement an `insert` operation, which inserts the given key in the tree (or does nothing if the key is already present). Preferably, you should also implement `split_node` method and use it properly in your `insert` implementation. The implementation uses the variant of (a,b)-trees from lecture notes by [Martin Mares, Chapter 3](http://mj.ucw.cz/vyuka/dsnotes/03-abtree.pdf) where the actual values are stored also in the internal nodes of the tree and not only in leaves. You should submit the `ab_tree.*` file (but not `ab_tree_test.*` files). Source code templates can be found in [git](https://gitlab.kam.mff.cuni.cz/datovky/assignments/-/tree/master). |