Monday, 2 March 2020


Stacks Concept

Image result for stack concept

A linear data structure implemented by either an array or a linked list. The array is follows the LIFO (Last In First Out) rule set. As a result the last data that was put into the array is also the first data that gets taken out first. A stack uses 2 important variables.
Max -> Represents the maximum data that can be stored.
Top -> Represents the most recent data.


Queue Concept
Image result for queue concept in data structure
A linear data structure where elements can only be inserted from the bottom and used from the top. This concept follows the FIFO (First In First Out) rule set.

Circular Queue
circularqueues

In a circular queue the start of the queue connects to the end of the queue thus creating a circular pattern in which the elements are rotated upon.





Infix, Prefix, Postfix
Infix, prefix and postfix are three different but equivalent ways of writing expressions.
Image result for prefix postfix infix


Infix = Operators are written in-between their operands. ( X + Y )
Prefix = Operators are written before their operands ( + X Y )
Postfix = Operators are written after their operands. ( X Y + )

Depth First Search (DFS)
Depth First Search is an algorithm used for searching within a tree or graph formed data structure. The algorithm starts at the root node and explores as far as possible along each branch before backtracking

Breadth First Search (BFS)
Breadth First Search is an algorithm used for searching within a tree or graph formed data structure. The algorithm starts at the tree root and explores all of the neighbor nodes at the present depth prior to moving on to the nodes at the next depth level.
Breath First Search uses the opposite strategy as DFS. In DFS it explores the node branch as far as possible before backtracking and then expanding to other nodes.


No comments:

Post a Comment