[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
>exam in data structures Might as well kill myself, how do
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 39
Thread images: 4
File: data structures.jpg (145 KB, 980x700) Image search: [Google]
data structures.jpg
145 KB, 980x700
>exam in data structures
Might as well kill myself, how do you remember how to implement e.g. binary trees and search algorithms?
>>
with your brain you high school faggot
>>
>>53276271
my iphone is my brain
>>
>>53276251
Implement them. Repeat repeat repeat. When you've repeated enough, repeat once again. Then you'll be ready.
>>
Copy your clever friends u mong
>>
In the real world nobody remembers. We all use Vim or whatver our text editor or ide of choice is and save data structure templates as hotkeys or import the structure if the language permits.

You end up learning exacty how to use them, and memorize their structure, but if some throws a piece of paper and pencil at most programmers, they couldnt write a linked list
>>
>>53276251
First understand how they work, then it's easy to implement. Implementing it efficiently or optimally is another thing.
>>
>>53276541
lol wow what a moron
>>
>>53276541
>You end up learning exacty how to use them, and memorize their structure, but if some throws a piece of paper and pencil at most programmers, they couldnt write a linked list
Those are some very shitty programmers. Probably your typical app dev and web dev guys.
You should be able to write a linked list in your sleep.
>>
>>53276585
>You should be able to write a linked list in your sleep.
What for? If the computer can do a task faster and better than me I might as well let the computer do it.
>>
>>53276612
Because it's easy.
It's the same as x + y, sure you might use calculator for big numbers but if you can't calculate on paper in your sleep you should kill yourself.
>>
>>53276612
Lol. Just lol. No it can't. The library you're using is written by humans and a linked list is so simple to implement naively that you shouldn't even think about it, just do it.
If you can't imagine a linked list then you got serious problems, man. An optimized one is another question.
How do you understand the limitations of it if you can't even imagine and write a naive implementation? How do you understand how good is the performance of the implementation you use? Do you know why a naive implementation is slow? Do you know how pointers (other accesses too) can trash the cache? Why memory access needs to be ordered in high performance code properly? Even if you don't use this, at least a basic level of understanding helps with understanding when you use something how to utilize it properly.
>>
>>53276677
kill yourself system slave
>>
>>53276691
Lol wut. Found the webdev.
>>
bubble/selection/insertion sort average case: O(n^2)
merge/quick sort average case: O(n log n), worst case: O(n^2)
Hash tables: O(1), worst case: O(n)
>>
/g/ - Student Advice
>>
Don't memorize; understand it.
>>
>>53276691
>get told
>muh s-s-system slave
>>
>>53277655
this
>>
>>53276691
Lol the jealous butt hurt is strong with this one. Maybe you should stick to style sheets.
>>
File: 1455920956810.jpg (808 KB, 1126x989) Image search: [Google]
1455920956810.jpg
808 KB, 1126x989
>not having a workspace where you could easily look up the implementation
Unless you have to completely balance the tree it should be fairly easy.
node class with data and pointors to the children.
Then something with asking if root is null. or if the data is bigger or smaller than root.
Traverse recursively.
>>
>>53276585

I've found the elitist babby.

Off yourself faggot, writing previously defined data structures is a pointless task. Why don't you go show everyone that new item you invented? Oh wait, it's a fucking wheel. No one gives a shit.
>>
>>53276251
>Might as well kill myself, how do you remember how to implement e.g. binary trees and search algorithms?
By fundamentally understanding their nature and having independently developed the concept and algorithms for my own purposes.
>>
>>53276305
This is the best advice in the thread desu.

Try to think of some simple stupid project that uses the data structure and algorithm and then write it. If you're having trouble coming up with something, ask your professor. They'll have a good idea of what kinds of problems lend themselves well to a particular data structure.

I never had to study for my exams because I would incorporate whatever I was learning into my stupid hobby projects.
>>
>>53278134
But I have more interesting things to develop than wasting time on something that has already been done a million times
>>
>>53276251
Lol
>>
>>53276251

>binary trees
It is a tree with only two leaves. You know how to implement trees, right?

>search algorithms
Pay attention in class. Searching in a BST is pretty trivial.

>>53277943

Whether or not the task is pointless, it is simple. if someone asks you to implement a linked list on paper for a grade (or for an interview), you should be able to implement one in C without much thought.

And that isn't elitism. If you know how a linked list is designed, implementing one is extremely trivial.
>>
>>53276251
What is hard about implementing binary trees? All you have to do is make a node class that contains pointers to left and right nodes

class TreeNode:
def __init__(self, val):
self.val = val
self.left = None
self.right = None

that's literally all a binary tree is
>>
>>53276305
yes do the actual work, do the exercises in your textbooks, check out hackerrank or other sources of free questions.
>>
I'm taking data structures next year. What kinds of topics am I expected to learn? I already know how nodes and linkedlists work, as well as searching through them
>>
>>53278801
he probably meant self-balancing binary trees
>>
>>53276291
then you have failed
>>
Pray to Cutler's ghost for mercy.
>>
Just fucking pass it. I'm in DS2 as I type this, it only gets worse.
>>
>>53276251
>hurr lets study CS because bideo gaemz :DDDD
Kill yourself.
>>
File: 1437258188477.png (515 KB, 744x655) Image search: [Google]
1437258188477.png
515 KB, 744x655
>be me
>take data structures exam
>fill-in-the-blank questions for the prof's indian-tier implementation of obscure data structures
>given only 3 lines of code in both directions to discern context
>it class class methods
>i'm supposed to have memorized this or something
>>
>>53279434
>What kinds of topics am I expected to learn?
data structures

>next year
wut, which year are you. who takes data structures (hopefully) on second year
>>
>>53279434
there's also queues,stacks and probably algorithms like quicksort/mergesort, bubblesort
>>
File: 1429338718919.png (27 KB, 407x446) Image search: [Google]
1429338718919.png
27 KB, 407x446
>took data struct 1st year uni
>forget it 4 years later
>it was on job interview exams
Thread replies: 39
Thread images: 4

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.