paint-brush
Java Algorithms: Coding a Binary Tree Right Side View (LeetCode)by@rakhmedovrs
163,769 reads
163,769 reads

Java Algorithms: Coding a Binary Tree Right Side View (LeetCode)

by Ruslan Rakhmedov4mAugust 10th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow
EN

Too Long; Didn't Read

Given the root of a binary tree, imagine yourself standing on the right side of it. Then, return the values of the nodes you can see ordered from top to bottom. I would say it’s a pretty popular question during coding interviews Using simple words — think of the level for a particular node in a binary tree as the depth of that node. This code gives us linear time and space complexity, and it performs pretty well.
featured image - Java Algorithms: Coding a Binary Tree Right Side View (LeetCode)
Ruslan Rakhmedov HackerNoon profile picture
Ruslan Rakhmedov

Ruslan Rakhmedov

@rakhmedovrs

Senior Software Engineer. As a hobby I do competitive programming

Learn More
LEARN MORE ABOUT @RAKHMEDOVRS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Ruslan Rakhmedov HackerNoon profile picture
Ruslan Rakhmedov@rakhmedovrs
Senior Software Engineer. As a hobby I do competitive programming

TOPICS

Languages

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite