Uncategorized

Shortest path in an unweighted graph

Problem Statement Given the directed, connected and unweighted graph G, a Source and a Destination and the task to find the shortest path possible between two given vertices in the graph. Note: The path does not contain any cycle which means path have finite number of vertices. Example Input Expected Output Path : 0 3 Implementation in …

Shortest path in an unweighted graph Read More »

Sort Integers by The Number of 1 Bits

Problem Statement Given an integer array arr. You have to sort the integers in the array in ascending order by the number of 1’s in their binary representation and in case of two or more integers have the same number of 1’s you have to sort them in ascending order. Return the sorted array. Sample Test Cases Problem Solution

Scroll to Top
[gravityforms id="5" description="false" titla="false" ajax="true"]