Posts
Gaurav's GitHub Page
Cancel

Heap Sort (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an array of size N. The task is to sort the array elements by completing functions heapify() and buildHeap() which are used to implement Heap Sort. geeksforgeeks SOLUTI...

Palindrome Pairs (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an array of strings arr[] of size N, find if there exists 2 strings arr[i] and arr[j] such that arr[i]+arr[j] is a palindrome i.e the concatenation of string arr[i] and a...

Common Elements (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given two lists V1 and V2 of sizes n and m respectively. Return the list of elements common to both the lists and return the list in sorted order. Duplicates may be there in th...

Minimum XOR value pair (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an array of integers of size N find minimum xor of any 2 elements. geeksforgeeks SOLUTION APPROACH 1 The idea is to sort the array and then find the xor of all the nu...

Trie | (Delete) (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Trie is an efficient information retrieval data structure. This data structure is used to store Strings and search strings, String stored can also be deleted. Given a Trie root...

Insert and Search in a Trie (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Complete the Insert and Search functions for a Trie Data Structure. Insert: Accepts the Trie’s root and a string, modifies the root in-place, and returns nothing. Search:...

Strongly Connected Components (Kosaraju's Algo) (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a Directed Graph with V vertices (Numbered from 0 to V-1) and E edges, Find the number of strongly connected components in the graph. geeksforgeeks SOLUTION Good Expla...

Dijkstra Algorithm (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a weighted, undirected and connected graph of V vertices and an adjacency list adj where adj[i] is a list of lists containing two integers where the first integer of each...

Find the number of islands (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a grid of size n*m (n is the number of rows and m is the number of columns in the grid) consisting of ‘0’s (Water) and ‘1’s(Land). Find the number of islands. Note: An i...

Topological sort (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an adjacency list for a Directed Acyclic Graph (DAG) where adj_list[i] contains a list of all vertices j such that there is a directed edge from vertex i to vertex j, wit...