You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -279,20 +280,22 @@ If you want to store hierarchical data use Tree.
279
280
280
281
You should know about `Binary Tree` and `Binary Search Tree`.
281
282
282
-
####Binary Tree
283
+
### Binary Tree
283
284
284
285
A binary tree is a type of tree in which each node has `at most two children` (0, 1 or 2) which are referred as left child and right child.
285
286
286
287

287
288
288
-
####Binary Search Tree (BST)
289
+
### Binary Search Tree (BST)
289
290
290
291
In Binary Search Tree nodes are:
291
292
292
293
- The key in the left subtree is less than the key in its parent node.
293
294
- The key in the right subtree is greater or equal the key in its parent node.
294
295
295
-

296
+

297
+
298
+
BSTs get an average case of `O(log n)` on gets, adds, and deletes, but they can have a worst case of `O(n)` if you do something like add a sorted list to a BST. Go ahead, do a BST then add [1,2,3,4,5] to it.
296
299
297
300
### Trie
298
301
@@ -384,8 +387,12 @@ So in order to find median we can use the stich algorithm since arrays are alrea
384
387
385
388
### Quick Sort
386
389
390
+
When Browser's are not using Merge sort they most of the time use Quick sort variations.
0 commit comments