Posts

Showing posts from September, 2019

Stacks and queues

Image
Stacks and queues Stacks and queues are dynamic sets in which the element removed from the set by the DELETE operation is prespecified. In a stack, the element deleted from the set is the one most recently inserted: the stack implements a last-in, first-out, or LIFO, policy. Similarly, in a queue, the element deleted is always the one that has been in the set for the longest time: the queue implements a first-in, first-out, or FIFO, policy. There are several efficient ways to implement stacks and queues on a computer. In this section, we show how to use a simple array to implement each. Stacks  The INSERT operation on a stack is often called PUSH, and the DELETE operation, which does not take an element argument, is often called POP. These names are allusions to physical stacks, such as the spring-loaded stacks of plates used in cafeterias. The order in which plates are popped from the stack is the reverse of the order in which they were p...

Some good techniques to know

Some good techniques to know Data Structures 1. Queue 2. Stacks 3. Trees 4. Graphs Recursion Dynamic Programming  Divide and Conquer

Some Algorithms to look on

Some Algorithms to look on Sorting 1. Bubble sort 2. Quicksort 3. Heap sort 4. Merge sort 5. Piegonhole sort Searching 1. Linear Search  2. Binary Search 3. Breadth-first search 4. Depth-first search Greedy Alogos 1. Dijkstra 2. Floyd Warshall 3. Bellman-Fords More Algos 1. Kadane's Algorithm 2. Sieve of Eratosthenes