Data Structure


The queue is a data structure which process items using first in first out (FIFO) strategy. The queue has head and tail nodes. When the item inserts into the queue, the queue adds the items in the tail. The linked list store the next element address to the current node for identifying the next node. The last element linked list next node store NULL address.

A priority queue is a data structure with each element has a priority associated with it. The high priority element served before an element with low priority. Priority queue provides extra flexibility over sorting and quick access to the smallest and largest key in the queue.

The queue is an abstract data type, in which the element is inserted into the tail, and delete from the head. It stores the items using First in first out principle (FIFO). The queue can be implemented using an array or linked list. The enqueues insert an item to the tail. The dequeue removes the item from the head.

the union of two sets A and B is the set of all the elements which are either in A, or in B, or in both A and B. To get the union of two arrays

Given a binary tree, print it vertically. Perform vertical traversal of a binary tree. Given a binary tree, perform vertical traversal of it. In vertical traversal, we print nodes of a binary tree in vertical order

Given a string, find the first non-repeating character in it. Write a program to find first non-repeating char on it using the hash table.

Linear probing is a scheme in computer programming for resolving hash collisions of values of hash functions by sequentially searching the hash table for a free location.

Hash table uses key and value for storing the elements. If the key has duplicate value, it may lead to hashing Collision. Separate Chaining is one of name collision solution. It is a scheme which each position in the hash table has a list to handle collisions.