Arnab Chakraborty has Published 4293 Articles

Insufficient Nodes in Root to Leaf Paths in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 05-Mar-2020 06:54:00

279 Views

Suppose we have a binary tree. A node is known as insufficient if every such root to leaf path intersecting this node has sum strictly less than limit. We have to delete all insufficient nodes simultaneously, and return the root of the resulting binary tree. So if the tree is ... Read More

Basic Calculator II in Python

Arnab Chakraborty

Arnab Chakraborty

Updated on 04-Mar-2020 06:20:53

916 Views

Suppose we have to implement a basic calculator to evaluate a simple expression string. The expression string will hold only non-negative integers, some operators like, +, -, *, / and empty spaces. The integer division should take the quotient part only.So if the input is like “3+2*2”, then the output ... Read More

Insertion Sort List C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Feb-2020 10:56:31

499 Views

Suppose we have a linked list, we have to perform the insertion sort on this list. So if the list is like [9, 45, 23, 71, 80, 55], sorted list is [9, 23, 45, 55, 71, 80].To solve this, we will follow these steps −dummy := new Node with some ... Read More

Search in Rotated Sorted Array II in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 03-Feb-2020 10:18:57

242 Views

Consider we have an array sorted in ascending order. That is rotated at some pivot unknown to us beforehand. For example, if the array is like [0, 0, 1, 2, 2, 5, 6], this might become [2, 5, 6, 0, 0, 1, 2]. We have a target value to search. ... Read More

What is Thread cancellation?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jan-2020 11:07:24

6K+ Views

Terminating a thread before it has completed is called Thread cancellation. For an example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be canceled. Another situation might be occurred when a user presses a button on a web browser ... Read More

What is user-defined signal handler?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jan-2020 11:05:12

1K+ Views

Signals are software interrupts which sent to a program to indicate that an important event has occurred. A Signal may be handled by following one of two possible handlers:A default signal handlerA user-defined signal handlerUser-defined signal handler can override this default action that is called to handle the signal. Signals ... Read More

How to create a process in Linux?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jan-2020 10:54:58

14K+ Views

A program loaded into memory and executing is called a process. In simple, a process is a program in execution.Let’s inspect how to create a process in LinuxA new process can be created by the fork() system call. The new process consists of a copy of the address space of ... Read More

What is Amdahl's Law?

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jan-2020 10:48:44

8K+ Views

Amdahl’s LawSuppose, Moni have to attend an invitation. Moni’s another two friend Diya and Hena are also invited. There are conditions that all three friends have to go there separately and all of them have to be present at door to get into the hall. Now Moni is coming by ... Read More

Evaluate Reverse Polish Notation in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 31-Jan-2020 06:36:02

356 Views

Suppose we have a triangle. We have to find the minimum path sum from top to the bottom. In each step we can move to adjacent numbers on the row below.For example, if the following triangle is like[    [2],    [3, 4],    [6, 5, 7],    [4, 1, ... Read More

0/1 Knapsack using Branch and Bound in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 30-Jan-2020 05:48:08

2K+ Views

The idea is to implement the fact that the Greedy approach provides the best solution for Fractional Knapsack problem.To check whether a particular node can give us a better solution or not, we calculate the optimal solution (through the node) implementing Greedy approach. If the solution calculated by Greedy approach ... Read More

Advertisements