So you finally learned to code, huh?

So you finally learned to code, huh?

I bet you can't reverse a binary tree

Attached: images (7).jpg (739x415, 27K)

She can't even write a script without breaking the program

>anime
Cringe

>think this means just means flip child pointers for whole tree
>look it up
>apparently it's some weird rotation of the tree
I don't get it.

do your own homework faggot

Attached: mephisto.jpg (500x500, 51K)

Name a single use case for this other than fizzbuzzing

to get a job where you change the color of the buttons on a website created in 1998

in your imagination and nowhere else

>>think this means just means flip child pointers for whole tree
that's what it is though?

I dont get it, what kind of symmetry are we talking about here?
That node_ij = node!_ji?

data BTree a = Leaf a | Branch (BTree a) (BTree a)

reverse (Leaf x) = Leaf x
reverse (Branch l r) = Branch (reverse r) (reverse l)

>using the word "cringe" in 2019

Attached: 1431643443640.png (600x940, 733K)

Guess why Jow Forums was made, you colossal imbecile! Go back to Plebbit!

Being able to pass Google's interview a valid use case for reversing binary trees

That would actually be a good interview question.
'Tell me why you would ever want to reverse a binary tree'.

Why would I want to work at evilcorp? Would rather starve to death. Have some fucking morals zoomer.

Worst girl.

I could if I knew what a binary tree was

Who the hell can't reverse a binary tree?
Make it a bit challenging and say without recursion.

>reverse a binary tree
why the shit would you do that? It's carefully put in order for a reason, you know.

It will still be in order after you revert it.

>posts spongebob meme on Jow Forums

what. spongebob is based as fuck

Attached: 1510120452474.jpg (512x384, 27K)

well that's easy
anyone who knows what a pointer and recursion is could do that
do people actually think they need a CS degree for this?

something something databases

>without recursion
Literally impossible unless you know all of the data at compile time.

Attached: 1200px-Binary_tree.svg.png (1200x1000, 81K)

fucking 12 year olds

So you've posted your disgusting poorly drawed pedo cartoons again, huh?
R E D D I T S P A C I N G
I bet you've never had sex and will never have.

lmao

static void reverseTree(final TreeNode root) {
if (root == null) {
return;
}

final TreeNode temp = root.right;
root.right = root.left;
root.left = temp;

reverseTree(root.left);

reverseTree(root.right);
}

let's try something easier next time

What, left becomes right, and do that recursively down the tree? Is that supposed to be hard?

You would be shocked at how inept the majority of people are. Can someone pull out that screenshot of people that fail FizzBuzz as 5+ year programmers?

Kek, found the brainlet

Kek, found the brainlet

This. I've always wondered what exactly IS reversing a binary tree and why it's important, I'll ask the next candidate I interview.

complaining about anime on an anime website

You can do that with a simple stack.

Recursion is just starting a new stack frame on the calm stack, any recursion can be implemented the same way the recursion gets treated when implemented in a language, with a stack and a loop.

>a loop
loops are a form of recursion.

I will just google it
Why would you learn anything that you don't need right now ?

Attached: ^40B449B84CC3A8B26CF096D2D93F1C6D9B112DCD3C8BA4D11F^pimgpsh_fullsize_distr.png (649x649, 296K)

incorrect, idiot

>Be in uni
>have to slog through calculus, dsp, eelctronics and shiet
Il never learn to code

Attached: 1449231958087.jpg (850x947, 527K)

@70348208
Learn some computer science before posting on this board.

I don't even know how pointers work. How do I pointers? I understand loops and conditional, but how tf do pointers work? I get that it points to a var, object, or function, but I get lost when you stack pointers on top of each other.

Attached: 1553645473666.jpg (1280x720, 104K)

>>have to slog through calculus
>slog
>calculus
user...

Its boring

Attached: 1450021555085.gif (500x536, 388K)

I don't really understand this attitude. I like absorbing anything that might have even little bit of use in my profession, even if it is boring as shit.

Study something else on the side then

I dont like studying but I like taking tests, weird world

Not him but I need to dive in something practical to get interested by the theory behind. I only have a vague idea about what a binary tree could be used for (text parsing? computing a path?) and why It is useful to reverse it. some for sorting algorithm. I didn't said it was of no use, just that I never needed them. I do webdev for a living, this might explain it

woah, cute

>but I get lost when you stack pointers on top of each other.
what's so hard to understand? Pointers are just numbers that specify a location in memory. So a pointer to a pointer is actually a pointer to a number. Then that number can be interpreted as a pointer to another location in memory.

I get that in C
>char is a letter
>char* are sentences/paragraphs
But then I get lost on char** and char***

npm install reverse_binary_tree

You're kind of right and wrong at the same time. You're thinking about it in the wrong way.
char is a lettter, yes.
char* isn't sentences/paragraphs or a string. It can be used to represent a string, but C doesn't have strings. It's just a pointer to a single character, and there might be some more letters after it followed by a null terminator.
char*** is a pointer to char**, char** is a pointer to char*, and so on.

i'm the same as you user, i usually jsut cram the night before and can get like 70% ez

Mathematical yes, but on a computer what you have are jumps and labels, that's what you have to do repeated action, and that's a loop.

>do repeated action
Which is literally a form of recursion.

I'll be frank, after being out of uni and working for 4 years totally forgot how to do that.

>mathematicians frequently cite integral calculus as one of the hardest parts of their education

Anyone who considers ``calculus'' math isn't a mathematician.

Elaborate.

>on a computer what you have are jumps and labels
My computer implements this form of recursion using primitive recursion.

.t neet

Kill yourself stupid nigger

What is there to elaborate on? Anyone who calls an engineering discipline ``mathematics'' clearly doesn't know much about the subject.

to be fair, all of those people are from singapore or some other dumb asian country

Mathematics and engineering are not always mutually exclusive.

In what context is that a meaningful response to my post? Calling an engineering discipline ``mathematics'' just because it uses some results from the field is pure retardation. I guess all programmers are mathematicians too then. Why even have separate names for these two groups of people?

So how are you computing total recursive functions these days?

Recursion requires a sort of stack, jumping to previous instructions is not what's meant here by recursion. The iterative loops we're talking about are more analogous to what happens at the hardware level, and recursion requires you to generalise, which could mean loss of performance, when you could have stated explicitly that you want a loop.

@70351620
>Recursion requires a sort of stack
It simply doesn't. Didn't even bother reading the rest of the garbage you typed out when you are this blatantly wrong in the first sentence of your post.

>So how are you computing total recursive functions these days?
A lisp machine where the machine code is lisp.

Just because integral Calculus is on the engineering curriculum it doesn't mean it's "an engineering discipline". Imagine a venn diagram where math, physics and chemistry overlap, and in their intersections you have engineering. Integral Calculus is also a subject in physics, it doesn't make it a physics discipline. It is a concept/discipline that comes from mathematics first, and you can use it on entirely, solely abstract concepts with no application to engineering whatsoever if you so want.

Malaysia, I think. Muzzies and poverty.

does 'reverse' know how to operate upon BTree? I don't see a base case, unless BTree may be considered as a list. Is this an actual solution? Because it looks quite elegant if so.

>Just because integral Calculus is on the engineering curriculum it doesn't mean it's "an engineering discipline".
Who are you replying to? Nobody said that anywhere in this thread.
>Imagine a venn diagram where math, physics and chemistry overlap, and in their intersections you have engineering.
This is just plain retardation. Engineering isn't and has never been a part of mathematics (essentially by definition/design).
>Integral Calculus is also a subject in physics
Both of them come from the same overarching discipline used exclusively outside of mathematics, since ``integral calculus'' has zero applications within mathematics itself.
>It is a concept/discipline that comes from mathematics first
This is actually historically false, but you can keep believing that if it makes you feel more ``mathematical'' when you're doing engineering. Your type seems to enjoy that a lot for whatever reason.

you probably won't need much more than basic understanding that pointer is an address of your data in memory. check out c++11 magic pointers, define your array-like structures as vectors of objects, now all you need to understand is the basic idea of having a pointer inside of your shared_ptr and dereference -> operator thingy. char*** sounds weird for some, but defining a vector of vectors of vectors of chars is pretty obvious for anyone who's reading the code

well, unless you want to learn this pure c stuff, then who am i to stop you

>reverse (Leaf x) = Leaf x
>I don't see a base case
Are you legitimately blind?
>does 'reverse' know how to operate upon BTree?
Does a completely stand-alone function which is currently in the process of being told how to operate upon BTree already know how to operate upon BTree?

binary ReversedTree = reverse(generateBinaryTree());

How the fuck do I learn to code. Like where the hell do I start

Learn Python The Hard Way by Zed Shaw.
Pro tip: don't let the name scare you.

Learn you a Haskell is pretty decent.

I can do it in place.

I uh... reverse the arraylist by key?

anime website

>using the word "based" in 2019

anime website

Attached: 1546271727507.jpg (1920x1080, 599K)

>tfw at linear algebra
Can't wait to become video games after this class

please go back

faggot
calculus is F U N

>math has zero applications withing mathematics
I hope this is bait

Nope.
t. dropout working remote for $40/hr

Hoping that reality is bait is a sign of serious mental illness.

>tranny.
Faggot.

No, but I have a job, so therefore I am better than you and your gay ass tree.

Attached: 1421892724008.jpg (125x110, 6K)

No, I never went to college

The most newfag post I've ever read

Attached: 1548200129431.png (596x285, 201K)

This image is inaccurate. It's

*(&Moot + sizeof(Moot))