Java Algorithms: Coding a Binary Tree Right Side View (LeetCode)by@rakhmedovrs
160,429 reads

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

tldt arrow
EN
Read on Terminal Reader
Read this story w/o Javascript

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

@rakhmedovrs

Ruslan Rakhmedov


Receive Stories from @rakhmedovrs

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa