This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| //Iterative Relaxed B+Tree | |
| //Just pedagogical. Based off Per Vognsen's B+Tree code | |
| //https://gist.github.com/pervognsen/e7883b3de183fcd601c1edf7f7e9508b | |
| // cl -Zi -Od /INCREMENTAL:NO persistent_btree.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| //Partially Persistent B+Tree | |
| //Just pedagogical. Based off Per Vognsen's B+Tree code | |
| //https://gist.github.com/pervognsen/e7883b3de183fcd601c1edf7f7e9508b | |
| // cl -Zi -Od /INCREMENTAL:NO persistent_btree.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| //Partially Persistent B+Tree | |
| //Just pedagogical. Based off Per Vognsen's B+Tree code | |
| //https://gist.github.com/pervognsen/e7883b3de183fcd601c1edf7f7e9508b | |
| // cl -Zi -Od /INCREMENTAL:NO persistent_btree.c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| #include <windows.h> | |
| //Partially Persistent Red-Black Tree | |
| //Imperative implementation of "Faster, Simpler Red-Black Trees" by Cameron Moy | |
| //Implemented using Zippers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| #include <string.h> | |
| //Imperative implementation of "Faster, Simpler Red-Black Trees" by Cameron Moy | |
| //https://ccs.neu.edu/~camoy/pub/red-black-tree.pdf | |
| //https://github.com/zarif98sjs/RedBlackTree-An-Intuitive-Approach | |
| //https://ranger.uta.edu/~weems/NOTES5311/sigcse05.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function leak_hole() { | |
| let x; | |
| delete x?.[y]?.a; | |
| return y; | |
| let y; | |
| } | |
| function pwn() { | |
| let hole = leak_hole(); | |
| %DebugPrint(hole); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| #include <assert.h> | |
| //https://sedgewick.io/wp-content/themes/sedgewick/papers/2008LLRB.pdf | |
| //Partially Persistent Left-leaning Red-Black Tree |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| #include <assert.h> | |
| //Just pedagogical. No proper memory managagement here, would use Arenas in practice | |
| #define NODE_CHILD_COUNT 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| #include <stdbool.h> | |
| #include <malloc.h> | |
| #include <assert.h> | |
| //Partially Persistent Left-Leaning Red-Black Tree | |
| //Implemented using Zippers | |
| //https://sedgewick.io/wp-content/themes/sedgewick/papers/2008LLRB.pdf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Preconditons | |
| //---------------------- | |
| // (1) The receiver must be a regular object and the key a unique name. | |
| // this excludes special objects such as globalThis, wasm object, etc | |
| // (2) The property to be deleted must be the last property. | |
| // (3) The property to be deleted must be deletable. | |
| // this excludes non-configurable properties. So no frozen or sealed objects. | |
| // (4) The map must have a back pointer. | |
| // this excludes prototype maps | |
| // (5) The last transition must have been caused by adding a property |
NewerOlder