I mean, surely you did it for the exercise, right? If you needed a solution, you could’ve very likely used a library…
Today I learned the term Vibe Coding. I love it.
Edit: This article is a treasure.
The concept of vibe coding elaborates on Karpathy’s claim from 2023 that “the hottest new programming language is English”,
Claim from 2023?! Lol. I’ve heard (BASIC) that (COBOL) before (Ruby).
A key part of the definition of vibe coding is that the user accepts code without full understanding.[1] AI researcher Simon Willison said: “If an LLM wrote every line of your code, but you’ve reviewed, tested, and understood it all, that’s not vibe coding in my book—that’s using an LLM as a typing assistant.”[1]
Did we make it from AI hype to AI dunk in the space of a single Wikipedia article? Lol.
Interesting that the term was coined by someone who presumably intended it to mean a good thing. I assumed it to be an entirely derogatory term…
Dude, love ❤️
Just wait until the vibe coder overwrites 3 months of “work” with garbage because ChatGPT never told them about git and then decided to poop the pants.
idk man. Algorithms are always the fun part for me. Real work, not so much.
I love the in between, where you have to actually adapt algorithms to useful situations
It’s like 2% of all the work I do, but those moments stick with me
Now… Now… Wait until they have to debug it
They will resort to vibe debugging
Or fix a simple syntax error. I’ve seen that a few times from juniors who thought they were too smart to learn, and it’s painful to watch.
Yup, seeing that too. They’re all proud of the work they didn’t do, but the second there’s a syntax error they panic.
LLMs excel at fixing typos. That’s honestly the most useful aspect of them.
Vibe coder?
Can someone explain?
A binary tree is one way of preparing data, usually for sorting. Each node can have a left, right, or both, children.
A / \ B C / \ D E
“Inverting the tree” means swapping the children for each node, so that the order that the nodes are visited is reversed. Depending on whether you want to copy the tree or swap it in place then the algorithm is different. C++ provides iterators too, so providing a “order reversed” iterator can be done efficiently as well.
You’re going to have to visit every node and do at least one swap for every node, and an efficient algorithm won’t do much more than that. Bring unable to do it suggests that the student programmer doesn’t understand stacks or recursion yet, so they’ve more to learn.
Important context:
This is often an exercise for beginning programmers, it’s a very simple task that’s easy to understand, but leaves enough room in the implementation to make it a good exercise.
Sometimes it’s used as a test on job applications, which is total bullshit, it isn’t a good test of someones actual skills as a software developer. Because of this it’s become a bit of a joke on the internet.
I’ve always stayed away from tree algorithms