terminology - What do Push and Pop mean for Stacks? -


long story short lecturer crap, , showing infix prefix stacks via overhead projector , bigass shadow blocking missed important stuff

he referring push , pop, push = 0 pop = x

he gave example cant see how gets answer @ all,

2*3/(2-1)+5*(4-1) 

step 1 reverse : )1-4(*5+)1-2(/3*2 ok can see that

he went on writing x's , o's operations , got totally lost

answer 14-5*12-32*/+ reversed again +/*23-21*5-41

if 1 explain me push pop understand greatful, have looked online alot stuff im finding seems step above this, need understanding here first

hopefully visualize stack, , how works.

empty stack:

|     | |     | |     | ------- 

after pushing a, get:

|     | |     | |   | ------- 

after pushing b, get:

|     | |  b  | |   | ------- 

after popping, get:

|     | |     | |   | ------- 

after pushing c, get:

|     | |  c  | |   | ------- 

after popping, get:

|     | |     | |   | ------- 

after popping, get:

|     | |     | |     | ------- 

Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c++ - Convert big endian to little endian when reading from a binary file -