Ryan McBeth
Ryan McBeth
@RyanMcBethProgramming·1.1M subscribers·1.8K videos

Reverse a binary tree in C# for a job interview (Updated)

Posted

September 11, 2021

Views

7,209

Likes

284

Comments

30

Engagement

4.36%

Search the Record

Indexed

Every word spoken in this episode is indexed. Type any phrase to jump straight to the moment it was said.

Type any word or phrase that may have been spoken. Click a result to seek the player to that exact moment.

Try a name, a topic, or a quoted line

YouTube Description

as posted by the channel

Reversing a binary tree is so easy that even Joe Rogan can do it!

It's one of those questions that is asked a lot in a job interview because senior developers want to see how you work your way through the problem.

Just follow the algorithm: RE-BESII.

RE - Write the REverse Method

B - If both the left node and right node are null, return.

E - Else

S - Swap the nodes

I - If the left node is not null, send the left node to reverse.

I - If the right node is not null, send the right node to reverse.

And that's it! That's all you have to do.

The code for this can be found at:

or

ryanmcbeth.com

Guests & Subjects Covered

Joe RoganRE-BESII REREverse Method BElse S

Sentinel Indexing in Progress

Metadata and chapters are available. Claim extraction for this episode is pending.

All video content is delivered via YouTube embedded players in accordance with the YouTube Terms of Service. Sentinel provides research tools that promote discovery and accountability across political media.

Reverse a binary tree in C# for a job interview (Updated) · Ryan McBeth · Sentinel