Skip to content

Commit 97663b6

Browse files
committed
add 004. Binary Tree Nodes
1 parent 0c24884 commit 97663b6

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<p align="center"><a href="https://www.hackerrank.com/marinskiy"><img src="https://i0.wp.com/gradsingames.com/wp-content/uploads/2016/05/856771_668224053197841_1943699009_o.png" ></a></p>
22

33
# Solutions to Hackerrank practice problems
4-
This repository contains 65 solutions to Hackerrank practice problems with Python and Oracle SQL.
4+
This repository contains 66 solutions to Hackerrank practice problems with Python and Oracle SQL.
55

66
Updated daily :) If it was helpful please press a star.
77

@@ -65,6 +65,7 @@ Updated daily :) If it was helpful please press a star.
6565
02. Advanced Select
6666
- Type of Triangle | [Problem](https://www.hackerrank.com/challenges/what-type-of-triangle/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/02.%20Advanced%20Select/001.%20Type%20of%20Triangle.sql) | Score: 20
6767
- The PADS | [Problem](https://www.hackerrank.com/challenges/the-pads/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/02.%20Advanced%20Select/002.%20The%20PADS.sql) | Score: 30
68+
- Binary Tree Nodes | [Problem](https://www.hackerrank.com/challenges/binary-search-tree-1/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/02.%20Advanced%20Select/004.%20Binary%20Tree%20Nodes.sql) | Score: 30
6869
03. Aggregation
6970
- Revising Aggregations - The Count Function | [Problem](https://www.hackerrank.com/challenges/revising-aggregations-the-count-function/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/03.%20Aggregation/001.%20Revising%20Aggregations%20-%20The%20Count%20Function.sql) | Score: 10
7071
- Revising Aggregations - The Sum Function | [Problem](https://www.hackerrank.com/challenges/revising-aggregations-sum/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/03.%20Aggregation/002.%20Revising%20Aggregations%20-%20The%20Sum%20Function.sql) | Score: 10
@@ -88,5 +89,3 @@ Updated daily :) If it was helpful please press a star.
8889
- African Cities | [Problem](https://www.hackerrank.com/challenges/african-cities/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/04.%20Basic%20Join/002.%20African%20Cities.sql) | Score: 10
8990
- Average Population of Each Continent | [Problem](https://www.hackerrank.com/challenges/average-population-of-each-continent/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/04.%20Basic%20Join/003.%20Average%20Population%20of%20Each%20Continent.sql) | Score: 10
9091
- The Report | [Problem](https://www.hackerrank.com/challenges/the-report/problem) | [Solution](https://github.com/marinskiy/HackerrankPractice/blob/master/SQL/04.%20Basic%20Join/004.%20The%20Report.sql) | Score: 20
91-
05. Advanced Join
92-
06. Alternative Queries
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- # Problem: https://www.hackerrank.com/challenges/binary-search-tree-1/problem
2+
-- # Score: 30
3+
4+
5+
SELECT N,
6+
CASE
7+
WHEN P IS NULL THEN 'Root'
8+
WHEN N IN (SELECT P FROM BST) THEN 'Inner'
9+
ELSE 'Leaf'
10+
END
11+
FROM BST
12+
ORDER BY N;

0 commit comments

Comments
 (0)