Home
Gaurav's GitHub Page
Cancel

Page Faults in LRU (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION In operating systems that use paging for memory management, page replacement algorithm is needed to decide which page needs to be replaced when the new page comes in. Whenever ...

Minimum number of Coins (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given an infinite supply of each denomination of Indian currency { 1, 2, 5, 10, 20, 50, 100, 200, 500, 2000 } and a target value N. Find the minimum number of coins and/or note...

Largest number possible (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given two numbers ‘N’ and ‘S’ , find the largest number that can be formed with ‘N’ digits and whose sum of digits should be equals to ‘S’. Return -1 if it is not possible. ge...

N meetings in one room (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION You are given timings of n meetings in the form of (start[i], end[i]) where start[i] is the start time of meeting i and end[i] is the finish time of meeting i. Return the maxim...

Maximum Path Sum between 2 Special Nodes (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a binary tree in which each node element contains a number. Find the maximum possible path sum from one special node to another special node. Note: Here special node is ...

Graph is Tree or Not (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION You are given an undirected graph of N nodes (numbered from 0 to N-1) and M edges. Return 1 if the graph is a tree, else return 0. Note: The input graph can have self-loops an...

Merge two BST's (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given two BSTs, return elements of merged BSTs in sorted form. geeksforgeeks SOLUTION We can solve this by performing inorder traversals on both binary search trees to get s...

Serialize and deserialize a binary tree (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Serialization is to store a tree in an array so that it can be later restored and deserialization is reading tree back from the array. Complete the functions serialize() : ...

Connect Nodes at Same Level (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a binary tree, connect the nodes that are at same level. You’ll be given an addition nextRight pointer for the same. Initially, all the nextRight pointers point to garba...

Vertical Tree Traversal (geeksforgeeks - SDE Sheet)

PROBLEM DESCRIPTION Given a Binary Tree, find the vertical traversal of it starting from the leftmost level to the rightmost level. If there are multiple nodes passing through a vertical line, the...