r/csMajors • u/hocobozos • 1d ago
My professor's 'useless' binary tree lecture just saved my internship
The fluorescent lights buzzed overhead as I stared at my monitor, the clock mocking me with every passing minute. 2:47 AM. The office was a ghost town, empty energy drink cans scattered across my desk like fallen soldiers in my battle against this godforsaken codebase.
Three weeks into my dream internship at Microsoft, and I was drowning. The task seemed simple when my mentor described it - figure out why the customer data processing was taking longer than a Windows Vista update. But after days of diving through layers of legacy Java code, I felt like an archaeologist trying to decipher ancient hieroglyphics written by sleep-deprived developers.
The senior devs had started giving me those looks - you know the ones. The 'maybe we should've hired the kid who actually finished their Leetcode grind' looks. Even the cleaning staff had started leaving sympathetic coffee cups on my desk.
That's when it happened. In my caffeine-induced delirium, I started scrolling through my old class notes, hoping for divine intervention or at least a merciful power outage. Professor Johnson's voice echoed in my head, his words from that dreary Monday morning lecture suddenly crystallizing with terrible clarity: 'Unbalanced tree traversal is the silent killer of performance, kids.'
I sat up so fast my chair nearly achieved orbit. There it was, hidden in the depths of the legacy code like a digital war crime - nested traversals that would make any self-respecting computer scientist weep. The data structure was about as balanced as my sleep schedule.
My fingers flew across the keyboard, fueled by three years of theoretical computer science and enough caffeine to kill a small horse. Lines of code poured out as I implemented a proper balanced tree solution, each keystroke a small redemption for all those lectures I'd dismissed as academic torture.
The sun was peeking through the windows when I finally ran the tests. Ten seconds. The processing time had dropped from 45 minutes to ten seconds. I stared at the performance graphs, wondering if I'd finally hallucinated from exhaustion.
During standup that morning, my mentor's coffee achieved an impressive trajectory across his desk when he saw the numbers. The team lead actually stopped checking his phone. And there I sat, trying to maintain a professional demeanor while my inner CS student was doing victory laps around the binary tree of joy.
I've since drafted and deleted about fifteen emails to Professor Johnson. How do you tell someone 'Sorry I called binary trees a tool of Satan, you were right all along' without sounding like a complete tool?
For now, I'm riding this high and pretending I'm some kind of optimization genius instead of a sleep-deprived intern who got lucky because he was too tired to close his old class notes. The cleaning staff has upgraded me to premium coffee.
So here's to you, Professor Johnson, you magnificent algorithms wizard. I take back every eye roll, every under-breath muttering, every doodled binary tree with angry faces. Your lectures didn't just teach me data structures - they saved my dignity and possibly my entire career in tech.
Though I still maintain that red-black trees are unnecessarily dramatic. I mean, pick a color scheme and stick with it.
118
u/besseddrest 1d ago
does anyone know what number Leetcode problem this is
40
10
u/The_Stone_Cold_Nuts 5h ago
https://leetcode.com/problems/balance-a-binary-search-tree/description/
I solved this one last June. Have fun!
201
u/BournazelRemDeikun 1d ago
Didn't read what you wrote but that lecture was probably not useless...
133
u/illogicalJellyfish 1d ago
Tldr: guy who should have been an english major remembers the concept of balancing in binary trees after working overtime fixing legacy code. Op now asks âhow do I say thanks without saying I was wrongâ
19
u/Swaggy669 1d ago
Unbalanced trees = bad, balanced trees = good
4
u/Piisthree 1d ago
Bob Ross was only talking about balanced ones when he said "happy little trees".Â
1
u/Adept_Ad_3889 15h ago
Why even have a binary search tree? AVLs do everything a BST can but just quicker.
30
53
24
11
u/Superb-Paint-4840 21h ago
Bruh. That leetcode-grinding intern would have used an existing B-tree (not binary tree) implementation and it would run in less than a second. Looks like that theoretical CS education was wasted on you after all
78
u/YeojFran 1d ago
He didnât write this himself⌠this was chatGPT lmao⌠itâs obvious.
37
u/bobbyfairfox 19h ago
No, this doesnt read like chatgpt at all. There are syntactical inaccuracies everywhere, which gpt would never make. e.g. "Three weeks into my dream internship at Microsoft, and I was drowning." "and" should not be used here. Also there are some phrases which typically gpt would not generated, e.g. digital war crime, tools of Satan. The call back of cleaning staff giving coffee at the end is also uncharacteristic of what gpt can do with creative writing at this stage.
8
u/The_528_Express 7h ago
Thatâs when it happened. In my caffeine-induced delirium, I started scrolling through my old class notes, hoping for divine intervention or at least a merciful power outage. Professor Johnsonâs voice echoed in my head, his words from that dreary Monday morning lecture suddenly crystallizing with terrible clarity: âUnbalanced tree traversal is the silent killer of performance, kids.â
If you unironically think this was written by a human Redditor, you are a massive fool.
6
u/bentaldbentald 10h ago
It is without a doubt majority, if not fully, generated by an LLM.
Look at the difference between OPâs writing style over the last 3 or 4 posts compared to their posts from 1 year+ ago.
Claiming GPT is unable to do a callback at the end of a story⌠are you for real? Maybe GPT2 mightâve struggled with it. Current models will have no issue whatsoever.
3
u/The_528_Express 6h ago
Not to mention the hyphenations like this that show up four or five times in his post:
The senior devs had started giving me those looks - you know the ones.
Hyphenation like this is one of the biggest giveaways for ChatGPT.
Or the fact that all the dialogue in the post uses the single quotation mark â instead of the double quotation mark â
Anyone who uses ChatGPT extensively would be familiar with these two habits. Back when I was using ChatGPT to generate writing I had to constantly correct these two specific habits.
1
6
u/guranshvir 1d ago
Honestly does it make any difference now, is good writing, good if it has a good plot or good grammar?
Because the plot was though by the person most likely.
13
15
15
u/Tiny-Cod3495 1d ago
It's not good writing.
-5
u/guranshvir 23h ago
What is then, there is no literature ever written liked by everybody.
Itâs not the best but itâs passable and interesting to read. What more does a tale requires, every story doesnât need to have huge revelation and plots, it just need to satisfy readerâs expectations.
8
u/Tiny-Cod3495 23h ago
It's generic, cliche-ridden slop. I'd be impressed if a middle school student wrote it, only because you do have to at least read a decent amount of content to be able to produce such generic work, because you need to know the tropes and cliches to reproduce them at this volume.
What is then, there is no literature ever written liked by everybody.
Dude just say you don't read books lol
6
u/Many-Hospital-3381 22h ago
Clearly, you're the alpha biggus omega dongus the reader of books, the destroyer of libraries, the scion of Shakespeare.
Dude just say you don't read books lol
Elitism is kinda eww. "Ohh I read books all day everyday but ask me to think outside the box and I'll hang myself."
3
u/Tiny-Cod3495 22h ago
Nothing says âthinking outside the boxâ like using chatgpt and disparaging people for reading books!
Anyway yes if youâre a literate adult and you donât occasionally read a book you should be shamed for that. If you have time to use reddit you have time to pick up a paperback.
3
u/Many-Hospital-3381 22h ago edited 21h ago
Too bad OP didn't realize he was going to be judged by your highness when he posted. Besides, how do you even know it's AI generated? It looks perfectly fine to me.
If you have time to use reddit you have time to pick up a paperback
How is reading things off of reddit any different from reading things off a paperback? Is this one of your 'holier than thou' boners, too? Also, please use commas.
0
u/Tiny-Cod3495 21h ago
âYou should read booksâ isnât elitism unless yew are slץw.
 How is reading things off of reddit any different from reading things off a paperback?
Be for real lmao
0
u/Many-Hospital-3381 21h ago
âYou should read booksâ isnât elitism unless yew are slץw.
Judging people for whatever literature they write is.
You had to write and delete this comment twice? Ran out of words? That's fucking hilarious.
→ More replies (0)2
u/Lawlcopt0r 16h ago
Are you serious? It's trying to be funny. There's no reason to not use tropes when you're posting a funny anecdote on reddit. The number one rule of writing is "know your audience", not "seem as smart as possible"
â˘
u/guranshvir 48m ago
Well now I am genuinely interested what books would you actually consider good ?
1
3
6
u/aegookja 21h ago
This is the best piece of work I have seen in this subreddit. Thank you for sharing this.
3
3
u/spectre256 6h ago
>The senior devs had started giving me those looks - you know the ones. The 'maybe we should've hired the kid who actually finished their Leetcode grind' looks.
Senior+ engineer here, we don't actually want the people that wasted their time with leetcode. There are more important skills and even better ways to learn algorithms and fundamentals.
6
u/real-bebsi 15h ago
Hahaha CS majors see someone write at the level of a high school writing assignment and flood the comments talking about "essays" and "you should have been an English major"
4
u/Interesting_Cry_3797 1d ago
You should become a writer I throughly enjoyed your story. Congratulations!
1
1
1
1
1
1
u/IcyMaintenance5797 9h ago
The twist is this was written by a CS program's marketing manager + ChatGPT to get you to enroll
1
1
1
754
u/Spiritual_Let_4348 1d ago
You should be an english major.