Articles for author: Mehul Pandey

Z Algorithm for Pattern Searching

Z algorithm is an algorithm for searching a given pattern in a string. It is an efficient algorithm as it has linear time complexity. It has a time complexity of O(m+n), where m is the length of the string and n is the length of the pattern to be searched. Introduction to the Z Algorithm ...

Dijkstra’s Algorithm

Dijkstra Algorithm is a graph algorithm for finding the shortest path from a source node to all other nodes in a graph(single source shortest path). It is a type of greedy algorithm. It only works on weighted graphs with positive weights. It has a time complexity of $O(V^2)$ using the adjacency matrix representation of graph. ...