Featured Post

Hello! and Greetings! Nice to see you on my blog.

 

8/13/2022

LeetCode Day 8

 STACKSSS!!! 


Stacks were pretty cool. But i learned that stacks are so inter related to lists, and queues in python. Stacks are just an abstraction of lists and arrays so it was like talking in my third language.


Stacks of notes today:

- Finished working with stacks:

- I learned that changing the i in a for loop interation to skip something is impossible, thats not how it works. The for loop will iterate that many times no matter what. Use a while loop instead for that case

- Math operations are always stack related. See an operator, pop an element, evaluate, then push back on

- I have a habit of using extra space that I don't need

- If its a calculator problem, figure out how to do it yourself. polish reverse problem was so hard cause you didn't know how to do it yourself

- Stacks relate to backtracking and DP.

- In two problems today, variables replaced a stack. I have a feeling it was really specific to these problems, but its worthwhile noting not to constrict your thinking. Keep an open mind




No comments:

Post a Comment