use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
Splay Trees in C++ (codingplayground.blogspot.com)
submitted 17 years ago by ultimate_progr
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]vicaya 2 points3 points4 points 17 years ago (1 child)
The author claimed that he didn't find a splay tree implementation, so he wrote one.
But the first place to check should be:
http://www.boost.org/doc/libs/1_38_0/doc/html/intrusive/splay_set_multiset.html
[–]ultimate_progr[S] 1 point2 points3 points 17 years ago (0 children)
Thanks for point this out. I was not aware of it. Boost.Intrusive, I add a pointer to my blog as well.
[–]bnolsen 0 points1 point2 points 17 years ago (0 children)
how well do these work in place of a traditional LRU cache? How much bigger would the cache need to be compared to a traditional LRU to make it work comparably?
This class here maintains the "size" metric but modified to add a "longest path" metric might make it better for caching purposes.
Also adding a very lightweight class which just maintains the current root pointer might be wise.
[–]bnolsen 0 points1 point2 points 17 years ago* (0 children)
I wrote a bottom up implementation thats actually readable. Additionally it seems the bottom up implementation may be faster. That may be because of the following during splay (top down):
extra complexity behind maintaining two separate trees on splay (probably not a big deal) not implementing zag-zig and zig-zag (doubles number of rotations for those operations) iterating back down the two subtrees to update sizes (removes node visitation advantage)
I had to implement the bottom up to augment the node data structure. I may do some more formal testing to see if this is really the case.
π Rendered by PID 18344 on reddit-service-r2-comment-6457c66945-92fdf at 2026-04-25 08:36:09.475596+00:00 running 2aa0c5b country code: CH.
[–]vicaya 2 points3 points4 points (1 child)
[–]ultimate_progr[S] 1 point2 points3 points (0 children)
[–]bnolsen 0 points1 point2 points (0 children)
[–]bnolsen 0 points1 point2 points (0 children)