Shortest path in a maze – Lee Algorithm
Given a maze in the form of the binary rectangular matrix, find the shortest path’s length in a maze from a given source to a given destination.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven a maze in the form of the binary rectangular matrix, find the shortest path’s length in a maze from a given source to a given destination.
Quicksort is an efficient in-place sorting algorithm, which usually performs about two to three times faster than merge sort and heapsort when implemented well. Quicksort is a comparison sort, meaning that it can sort items of any type for which a less-than relation is defined.
Merge sort is an efficient sorting algorithm that produces a stable sort, which means that if two elements have the same value, they hold the same relative position in the sorted sequence as they did in the input.
Selection sort is an unstable, in-place sorting algorithm known for its simplicity. It has performance advantages over more complicated algorithms in certain situations, particularly where the auxiliary memory is limited.
Insertion sort is a stable, in-place sorting algorithm that builds the final sorted array one item at a time. It is not the very best in terms of performance but more efficient traditionally than most other simple O(n^2) algorithms such as selection sort or bubble sort.
Heapsort is an in-place, comparison-based sorting algorithm and can be thought of as an improved selection sort as it divides the input into a sorted and an unsorted region.
A priority queue is an ADT (Abstract Data Type) for maintaining a set S of elements, with each element having a “priority” associated with it. In a priority queue, an element with high priority is served before an element with low priority or vice versa.
This post will discuss the difference between a subarray, a substring, a subsequence, and a subset.
Given a set of vertices V in a weighted graph where its edge weights w(u, v) can be negative, find the shortest path weights d(s, v) from every source s for all vertices v present in the graph. If the graph contains a negative-weight cycle, report it.
Given a source vertex s from a set of vertices V in a weighted graph where its edge weights w(u, v) can be negative, find the shortest path weights d(s, v) from source s for all vertices v present in the graph. If the graph contains a negative-weight cycle, report it.
Given a source vertex s from a set of vertices V in a weighted graph where all its edge weights w(u, v) are non-negative, find the shortest path weights d(s, v) from source s for all vertices v present in the graph.
Given an undirected, connected and weighted graph, construct a minimum spanning tree out of it using Kruskal’s Algorithm.