Sinisterly
[Java] Visual Stack - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Java, JVM, & JRE (https://sinister.li/Forum-Java-JVM-JRE)
+--- Thread: [Java] Visual Stack (/Thread-Java-Visual-Stack)



[Java] Visual Stack - Psycho_Coder - 11-07-2013

Stack

Stack is a data structure that follows the LIFO (Last-In-First-Out) principle. Newly added elements are added to the top and the most recent inseretd data are to be removed first as well.


Visual Stack

This applet is very simple and shows the working of a stack.


Video Demonstration


Spoiler: Open


Screenshot

Spoiler: Open
[Image: visualstack_zps5e183d58.png]


Description

We have a text area and you need to write certain commands for this to work.

We need to know about the stack ADT first. A stack does the following operations :-

1. Push ; Pushes an element to the top.
2. Pop: Removes the top element
3. peek: Returns the top element.
4. size: returns the size of the stack.

We have 5 keywords here, namely - push, pop, top, size, and delay.

push and delay work as the following syntax :- <instruction> <single-space> <data>

push :- Push the data into the stack. Example : push you, push 2, push IAmDull etc
delays : delay the update of the stack and its visualization.

pop, top, size are single instructions.

pop : pops the top element.
top : Shows the top element in logs.
size : Shows the size of the stack in logs.

Code

https://github.com/PsychoCoderHC/VisualStack

PS: This has been kept very simple but can be extended for better capabilities. I might update it later. This applet has been specially made for HCDevs New Project started by @Deque.

You may except a detailed tutorial on Stacks very soon.



Thank you,
Sincerely,
Psycho_Coder


RE: [Java] Visual Stack - Deque - 11-07-2013

That's great. Many thanks. Biggrin


RE: [Java] Visual Stack - cervito21 - 11-26-2013

video remove Sad


RE: [Java] Visual Stack - cervito21 - 11-26-2013

video remove Sad


RE: [Java] Visual Stack - Psycho_Coder - 11-26-2013

(11-26-2013, 03:58 PM)cervito21 Wrote: video remove Sad

http://www.youtube.com/watch?v=MhA3GLfd7L4


RE: [Java] Visual Stack - Psycho_Coder - 11-26-2013

(11-26-2013, 03:58 PM)cervito21 Wrote: video remove Sad

http://www.youtube.com/watch?v=MhA3GLfd7L4


RE: [Java] Visual Stack - darthjames226 - 11-26-2013

Really good explanation.


RE: [Java] Visual Stack - darthjames226 - 11-26-2013

Really good explanation.