Question: https://leetcode.com/problems/binary-...
SQL Schema:
Create table If Not Exists Tree (N int,P int)
Truncate table Tree
insert into Tree (N, P) values ('1', '2')
insert into Tree (N, P) values ('3', '2')
insert into Tree (N, P) values ('6', '8')
insert into Tree (N, P) values ('9', '8')
insert into Tree (N, P) values ('2', '5')
insert into Tree (N, P) values ('8', '5')
insert into Tree (N, P) values ('5', 'None')
Pandas Schema:
data = [[1, 2], [3, 2], [6, 8], [9, 8], [2, 5], [8, 5], [5, None]]
tree = pd.DataFrame(data, columns=['N', 'P']).astype({'N':'Int64', 'P':'Int64'})
#leetcodesolutions #datascience #sql
On this page of the site you can watch the video online Leetcode MEDIUM 3054 - Binary Tree Nodes CASE WHEN DSA SQL - Explained by Everyday Data Science with a duration of hours minute second in good quality, which was uploaded by the user Everyday Data Science 31 July 2024, share the link with friends and acquaintances, this video has already been watched 213 times on youtube and it was liked by 6 viewers. Enjoy your viewing!