adding stack leetcode problem
This commit is contained in:
@@ -167,3 +167,5 @@ functionality.-->
|
||||
- [Leetcode problem 232: Implement Queue using Stacks](https://leetcode.com/problems/implement-queue-using-stacks/). Solution: [p232_queue_using_stacks.cpp](../../leetcode/p232_queue_using_stacks.cpp).
|
||||
- [Leetcode problem 102: Binary Tree Level Order Traversal](https://leetcode.com/problems/binary-tree-level-order-traversal/). Solution: [p102_level_order_traversal.cpp](../../leetcode/p102_level_order_traversal.cpp).
|
||||
- Play this [animation](https://jidongxiao.github.io/CSCI1200-DataStructures/animations/trees/level_order/index.html) to see how the level order traversal works.
|
||||
|
||||
- [Leetcode problem 20: Valid Parentheses](https://leetcode.com/problems/valid-parentheses/). Solution: [p20_valid_parentheses.cpp](../../leetcode/p20_valid_parentheses.cpp)
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
- What’s a Priority Queue?
|
||||
- A Priority Queue as a Heap
|
||||
- A Heap as a Vector
|
||||
- Building a Heap
|
||||
- Heap Sort
|
||||
|
||||
## 22.1 Range Based for Loop
|
||||
|
||||
@@ -117,9 +115,13 @@ Lambda is new to the C++ language (part of C++11). But lambda is a core piece of
|
||||
|
||||
- Draw two different binary heaps with these values: 52 13 48 7 32 40 18 25 4
|
||||
|
||||
- Draw several other trees with these values that not binary heaps.
|
||||
- Draw several other trees with these values which are not binary heaps.
|
||||
|
||||
## 22.7 Leetcode Exercises
|
||||
## 22.7 Implementing a Heap with a Vector (instead of Nodes & Pointers)
|
||||
|
||||
- The standard library (STL) priority_queue is implemented as a binary heap.
|
||||
|
||||
## 22.8 Leetcode Exercises
|
||||
|
||||
- [Leetcode problem 215: Kth Largest Element in an Array](https://leetcode.com/problems/rearrange-words-in-a-sentence/). Solution: [p1451_rearrange_words_in_a_sentence.cpp](../../leetcode/p1451_rearrange_words_in_a_sentence.cpp).
|
||||
- [Leetcode problem 373: Find K Pairs with Smallest Sums](https://leetcode.com/problems/most-frequent-subtree-sum/). Solution: [p508_most_frequent_subtree_sum.cpp](../../leetcode/p508_most_frequent_subtree_sum.cpp).
|
||||
|
||||
Reference in New Issue
Block a user