Arnab Chakraborty has Published 4293 Articles

Find the missing value from the given equation a + b = c in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 06:08:28

614 Views

Suppose we have one equation in this form: a + b = c, now any one of the terms of a, b or c is missing. We have to find the missing one.So, if the input is like ? + 4 = 9, then the output will be 5To solve ... Read More

Find the minimum time after which one can exchange notes in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 27-Aug-2020 06:06:20

138 Views

Suppose there are n number of cashiers exchanging the money, at the moment, the i-th cashier had ki number of people in front of him/her. Now, the j-th person in the line to i-th cashier had m[i, j] notes. We have to find how early can one exchange his/her notes. ... Read More

Find if there is a triplet in a Balanced BST that adds to zero in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:33:38

229 Views

Suppose we have a balanced binary search tree, we have to create a function named is_valid_triplet() that returns true when there exist a triplet in given BST whose sum equals to 0, otherwise returns false. Design the method by following these constraints −expected time complexity is O(n^2)O(logn) extra space can ... Read More

Find Itinerary from a given list of tickets in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:29:58

188 Views

Suppose we have a list of tickets represented by pairs of departure and arrival airports like [from, to], we have to find the itinerary in order. All of the tickets belong to a man who departs from Chennai. So, the itinerary must begin with Chennai.So if the input is like ... Read More

Find Jobs involved in Weighted Job Scheduling in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:25:51

231 Views

Suppose we have a list of N jobs where each job has three parameters. 1. Start Time 2. Finish Time 3. Profit We have to find a subset of jobs associated with maximum profit so that no two jobs in the subset overlap.So, if the input is like N = ... Read More

Find k-th smallest element in BST (Order Statistics in BST) in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:23:13

567 Views

Suppose we have a binary search tree and a value K as input, we have to find K-th smallest element in the tree.So, if the input is likek = 3, then the output will be 15.To solve this, we will follow these steps −Define a function find_kth_smallest(), this will take ... Read More

Find memory conflicts among multiple threads in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:19:14

202 Views

Suppose we have a RAM and that RAM is organized in blocks. there are multiple processes running on the system. We have to keep in mind that every process gets following information, (Thread T, Memory Block M, time t, R/W) This indicates the thread T was implementing memory block M ... Read More

Find minimum s-t cut in a flow network in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:16:47

356 Views

Suppose we have following flow network. As we know an s-t cut is a cut that requires the source s node and a sink t node to be in different subsets, and it includes edges going from the source set to the sink side. Here the capacity of an s-t ... Read More

Find pair for given sum in a sorted singly linked without extra space in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:11:04

175 Views

Suppose we have a singly linked list and a value x; we have to find a pair whose sum is same as x. We have to keep in mind that we cannot use any extra space and expected time complexity will be O(n).So, if the input is like 4→7→8→9→10→11→12, x ... Read More

Find pair of rows in a binary matrix that has maximum bit difference in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 25-Aug-2020 12:06:43

180 Views

Suppose we have a binary matrix; we have to find the pair of rows in the given matrix that has maximum bit difference.So, if the input is like matrix, then the output will be [2, 3] as bit difference between rows 2 and row 3 is 4, this is maximum.To ... Read More

Advertisements