Linked List Representation Of Stack Data Structure In Javascript | letsbug
In the article we are going to implement the data structure called stack . If you don't know about them you can visit my previous blog article for the same by clicking here . In this article we are going the implement the stack but not with array but with linked list . Now what is linked list? You can say linked list is data structure when one single linear data structure is made by linking many smaller nodes like a chain. To learn more about it please visit here. We will create a Node class which will be are individual node with next pointer and data property to store the data. Then we will link them in the stack class. And perform stack operations on the linked list. So let's get started Linked List Representation Of Stack Our Stack will have following methods or operations on it. Push() Pop() Peek() isEmpty() print() reverse() length() code: //create node class class Node { ...