Overview of data structures using Python Programming
In Linked list data structure, data is stored in forms of nodes(created using a Node class). Node class mainly contains two attributes, data and a point to next node. Each node in the list will have address to the next node in the series. The data could be scattered anywhere in the memory as long as the adddresses are stored in a Node object.
A stack is an ordered collection of items where the addition of new items and removal of existing items always takes place at the same end(top). Opposite end of top is known as base. Stack of books. LIFO principle.
A Queue is an ordered collection of items where the addition of new items happens at one end, called the 'rear', and the removal of existing items occurs at the other end commonly called the 'front'. Queue of people waiting outside bank. FIFO principle.
A deque, also known as a double-ended queue, is an ordered collection of items similar to the queue. It has two ends, a front and a rear, and the items remain positioned in the collection.
A tree data structure has a root, branches and leaves. The difference between a tree in nature and a tree in computer science is that a tree data structure has its root at the top and its leaves on the bottom. All of the children of one node are independent of the children of another node. Each leaf node is unique. Another example of a tree structure that you probably use every day is a file system. In a file system, directories or folders are structure as a tree.