Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "binary trees"
-
Just because you can learn HTML in a day doesn’t mean that you don’t need a degree.
Did you know that your browser, HTML, CSS, Javascript, and even your operating system use linked lists, binary trees, hash tables, and other so-called “useless” data structures?
It’s important to understand the roots and fundamentals of computer science even if you won’t use that knowledge day to day.
It changes your perspective on programming once you learn what actually goes on under the hood, and makes you think twice about the impact of what you write.
It’s relatively easy to get a programming job without a degree nowadays, but it often leads to web developers claiming that degrees aren’t important to their web apps.
There is much more than just the web to computer science, and that’s something to always keep in mind.10 -
Computer Scientists put the root at the top of their trees because they've never been outside to see what a real tree looks like3
-
If you're currently in college and wish to get placed in a major tech giant like Amazon or Facebook:
Don't learn React.js, instead learn Linked lists.
Don't learn Flutter, instead learn Binary search trees.
Don't learn how to perform secure Authorization with JWTs, instead learn how to recursively reverse a singly linked list.
Don't learn how to build scalable and fault tolerant web servers, instead learn how to optimally inverse a binary search tree.
These big tech companies don't really care what real world development technologies you've mastered. Your competence in competitive programming and data structures is all that matters.
The system is screwed. Or atleast I am.18 -
I was talking to my non-tech gf about how a colleague of mine didn't understand priority queue and show led her an example, during explanation fucked up the example and duplicated priorities of 2 values but they came up in the unexpected order. She wanted to find the logic in it and blamed the computer for being dumb, but it has been ~45 minutes, she has Wikipedia about binary trees & linked list open as well as simple graphs visualising both + armed with pen and paper trying to understand how it all all works..
Achievement Earned?
P.S I am either creating a monstrosity (Frankenstein style) or recruiting a fresh mind to our ranks, either way I am proud af 😢😊😍8 -
How many of you use the right data structures for the right situations?
As seasoned programmer and mentor Simon Allardice said: "I've met all sorts of programmers, but where the self-taught programmers fell short was knowing when to use the right data structure for the right situation. There are Arrays, ArrayLists, Sets, HashSets, singly linked Lists, doubly linked Lists, Stacks, Queues, Red-Black trees, Binary trees,.. and what the novice programmer does wrong is only use ArrayList for everything".
Most uni students don't have this problem though, for Data Structures is freshman year material. It's dry, complicated and a difficult to pass course, but it's crucial as a toolset for the programmer.
What's important is knowing what data structures are good in what situations and knowing their strengths and weaknesses. If you use an ArrayList to traverse and work with millions of records, it will be ten-fold as inefficient as using a Set. And so on, and so on.31 -
You know that the Algorithm & Data Structure exam is coming, when you start traversing binary search trees in your sleep2
-
Hi everyone. Thanks in advance. Although this might sound stupid, keep in mind that someone requested the following:
Someone on discord asked me to make an aim assist program for a game. I thought it might be a fun way to introduce myself to memory writing and binary trees. I accepted the request and started researching. I'm using C++ and I have some options if I need to switch programming languages. Honestly I don't know where to start, but I thought finding a color on the screen using ML or something then moving the mouse position might work. This is also one of my close friends so he wouldn't be too sad/mad if I failed the request.13 -
Here's my idea. In light of all the efforts to teach kids how to do programming, why not start with an introduction to discrete mathematics instead? From a lot of the programs I've seen, the kids are taught different structures such as if else, while, and for loops, but they don't attempt to start teaching them about recursive methods or even other structures such as linked lists, queues, dequeues, binary trees, heaps, different sorts, and other things. Am I just not looking deep enough into those programs? Or are the creators of these programs not wishing to cover those things because they feel like children wouldn't be able to comprehend such things?4
-
About half an year ago, I literally fought with my DS teacher for half an hour in front of whole class,
REASON:
That dude couldn't saw the infinite while loop on his BINARY SEARCH algo hand written on board...
I mean come on dude, binary search is one of the simplest algo, and he didn't agreed with me until he dry run his written code(PS: the only thing I liked about him...HE KNOWS HOW TO DRY RUN)....
Scariest part: He was supposed to teach us trees and graphs in about a month
And it was my first day in that class -
Have you ever seen a tree data structure implementation in any code base?
I wonder why recruiters are so desperately asking how to invert binary trees in my coding interviews🥴4 -
My university had a Programming Fundamentals course in the first semester and we got assigned this grumpy lady who demanded respect and would always claim she was the best at programming among her colleagues, had an obnoxiously snobbish tone and had a habit of forcing unneeded nonsensical sarcasm everytime one of us stepped up to ask her a question.
She taught C++ and I'm not saying she didn't know her stuff or anything; I respected her regardless (because she was my teacher), but she would mix up C classes in and insist that that was the right way to do it and had no consistent programming style.
Once she got so fed up with our class that just to prove her point that we're all dumb and worthless (she hated us a lot, yeah) that she started explaining binary trees and recursion out of the blue and gave us assignments for them... even though they weren't going to be covered that week. It soon became a shitfest, to be honest.
But on the plus side, because I didn't wanna listen to her lectures I pulled two all-nighters and covered the semester's worth of C++ and started napping in a corner in her class. She never had personal beef with me so I was thankful for that but her being the way she was helped me learn C++ with more motivation and vigor than I normally would have and also let me earn some change because my classmates couldn't understand her classes and wanted me to explain whatever she covered. -
So I see posts about an interview question/challenge of inverting a binary tree. I don't use trees very often (mainly file related or parsing server nodes), but I thought I would learn how to do this.
I saw a page that started talking about different ways to invert enough to understand that one type of inversion is swapping left and right nodes. So I stopped before they showed how.
Then I created a test program that has a tree structure and also can display a tree before and after modification. This was kind of fun.
So then I wrote the inversion function. It was less than 10 lines of code. Wtf? I thought it would be harder than this.
Then I started wondering where trees were used. So today I have been learning how they are used and why I might need one to solve a problem. One use I intuited was parsing regex or a language. Apparently it is useful there.
What I am learning is that a lot of these interview questions are really test to see if you can comprehend instructions when stressed. Or you will ask questions to clarify the task. It doesn't necessarily test your ability to solve hard problems.
One thing that perplexes me. If inverting a tree is swapping nodes left<->right, then why not leave data in place and just swap roles in the functions. Maybe I completely misunderstood what inversion means or why it would be done. I guess if this is not inverting I have the structure to try other methods now.2 -
And here it comes bois, the famous Monday Morning Mumbling is back, for everyone's pleasure.
Do you remember your uni years, when you had wonderful coding lessons, and you learned sick languages ?
I do aswell, since I'm still in uni.
But why, WHY, IN ALL OF GOD THOUGHTS, DO I STILL HAVE TO TAKE MATHS LESSONS ?
It's my fourth fucking uni year, and I'm still supposed to deal with math lessons which are about what I learned 6 years ago. And guess what ? I still failed the test since I fucking don't understand a single shit in maths.
"Uuuuh if yu wan tu derivate a function u hav to multiply ur derivated function basic expression with the derivate itself lul xDDD so funi"
FUCK OFF DUDES I DON'T GIVE A SINGLE SICK BIRD SHIT ABOUT MATHS. I WASTED THREE YEARS OF MY LIFE LEARNING ABOUT BINARY TREES, MATHEMATICALS WAYS OF SPILLING YOUR CEREAL BOWL WHEN YOU HAVE TO LEAVE IN FIVE MINUTES, NUMERIC WAY OF OPTIMIZE YOUR SINK SPACE WHEN YOU'RE TOO LAZY TO DO THE DISHES, JUST LET ME FUCKING WRITE CODE INSTEAD OF ANNOYING ME WITH UNEXPLAINABLE MATHS SHIT NOW !
I know maths are important, okay ? But I'm so fucking tired of learning this shit again and again and still failing those shitty tests where they only give you maths problems without any other goal than messing with your grades.
Fuck this shit I'm pissed off on so many levels, I wasted tons of money on a private school to enhance my résumé history, and now I'm stuck with some strange "f'(x)" boi that will ruin my year.
RT's appreciated, if you recognised yourself in this story, don't forget to send some biscuits to my postal address.
TL;DR : Why wasting your time on theoritical lessons when you could use your time to learn new dynamic technos, like C++98 ?2 -
Today I'm starting interviewcamp.io. I graduated from a 4-year university in California with a degree in computer engineering and have almost 3 years of work experience, but my god I am terrible at algorithms.
Big O (time and space complexity), recursion, Binary Search Trees, reversing a fucking linked list, etc. I need the boost and I hope the $250 a year for the material will help me get at least a $5k increase in salary when jumping to another company after the whole pandemic (or get a raise at my current job).
If anyone has any experience with them let me know. So far I'm 2 hours in and it is nice so far.3