Finding a Soul Mate
@Roady_Dragonfae People who are certain they are The One for you have shown that they believe they own, and have a claim to, the contents of your mind and behaviors you engage in. That's not going to be a safe start to almost any relationship...
@Elizafox if you want to watch a lecture from the woman who taught me, it's the "lecture 15" part of http://goldman.cse.wustl.edu/crc2007/lectures/compressed.html ; she's fantastic and even though this is material you've already seen maybe a different perspective from honestly the best professor I had would help.
@Elizafox the easiest way to make sense of it is to just pretend that the tree was fine before you added a node to it, and then you can fix it so it's okay again, and you don't have to worry about the rest. "the cool part" about red-black trees is how they figure out that they need to rebalance - the red-red rule is the only one necessary because it's the only rule that inserting a red node can break
@Elizafox yeah, red black trees were by far the hardest thing in Algorithms for me, and according to Dr. Goldman it was the hardest thing for everyone including her; "delete a node" was extra credit for our homework because it was considered too difficult for the main implementation
@Elizafox ...So painting the red root black adds 1 to the black depth of every single path simultaneously, since the root is the start of all paths - and then they're all equal again!
Also I realized I forgot the other rule for creating a black node, it doesn't always go through the root, sorry. (Black/black pairs can be "split".) But your fix-up algorithm only has to look at three layers of the tree at a time, working upwards from where your new red leaf comes in.
@Elizafox The other rule: the root is black, so you fix a red/red problem where the parent is the root by turning the root black. This is the only way to add black nodes - they rotate into the root. This happens when your rebalancing can't find a home for your extra red node so it makes it all the way to the root; all root-to-leaf paths are still "black equal" (because they were before you added a red node, your rotations don't change black depth, and your red node is red)...
@Elizafox Part of the rules: any new node is red; if its parent is black there is nothing to do, if there isn't the tree has to be fixed, which may involve flipping a few pointers around all the way back to the root
@Elizafox You don't have to count black nodes at all, because as long as the rules were true before you put the node in, and you followed the fixup algorithms (which I have also forgotten, and forgot shortly after my CS 241 Algorithms and Data Structures course), they will be true after
@Elizafox The idea of a red-black tree is that it keeps two rules - the black height is constant across the tree and there are no red children of red nodes - constant-ish. You insert stuff in the obvious way, eventually break the red/red rule, then in fixing it somehow unfuck the entire tree along the way
@Jacel 'MURICA.
Nicotine Withdrawal
@Roady_Dragonfae Consider heightened levels of black tea. Nicotine withdrawal is going to be difficult anyway but L-theanine is probably useful anyway
Playing for a Domination Victory in Civ is so weird, since I'm used to just building forever and then getting a cultural victory by accident. It feels like military conquest forever is what the game was built for, though, because the game pace works better and has more interesting decisions to make in ongoing military campaigns.
Chameleonic dragon. Otherkin. Some kind of eclectic neo-Pagan. Sie/hir or they/them. Software engineer. Seattle-esque, WA. Expect software takes, complaints about the tech industry, board games, video games, an inexplicably obsession with paper notebooks despite my handwriting, and Weird Furry Stuff.