GoogleSoftware Engineer · Phone ScreenCodemia practiceCount median in binary tree
Given a binary tree, write a function to calculate the median of all the values stored in the nodes. The function should return a single floating-point number representing the median, which is defined as the middle value when the values are sorted; if there is an even number of values, return the average of the two middle values.
Medium
Coding & Algorithms