Maximum spiral sum in Binary Tree in C++

Narendra Kumar
Published on 21-Jan-2020 11:36:03
Problem statementGiven a binary tree containing n nodes. The problem is to find the maximum sum obtained when the tree is spirally traversed. In spiral traversal one by one all levels are being traversed with the root level traversed from right to left, then next level from left to right, ... Read More

Maximum size subset with given sum in C++

Narendra Kumar
Published on 21-Jan-2020 11:28:40
Problem statementGiven an array of N elements and sum. We need to find size of maximum size subset whose sum is equal to given sumExampleIf input array is arr = { 2, 3, 5, 10 } and sum = 20 then output will be 4 as −2 + 3 + ... Read More

Maximum segment value after putting k breakpoints in a number in C++

Narendra Kumar
Published on 21-Jan-2020 11:24:32
Problem statementGiven a large number as string s and an integer k which denotes the number of breakpoints we must put in the number k <= string length. The task is to find maximum segment value after putting exactly k breakpoints.ExampleExample If s = 313 and k = 1 then ... Read More

Maximum removal from array when removal time >= waiting time in C++

Narendra Kumar
Published on 21-Jan-2020 11:20:35
Problem statementGiven an array of N elements. The task is to remove elements from the array from left to right. However, some time is required to remove an element from the array(let us call it removal time). The time to remove an element is equal to the value of the ... Read More

Maximum profit from sale of wines in C++

Narendra Kumar
Published on 21-Jan-2020 11:15:30
Problem statementGiven n wines in a row, with integers denoting the cost of each wine respectively. Each year you can sale the first or the last wine in the row. The price of wines increases over time. Let the initial profits from the wines be P1, P2, P3…Pn. On the ... Read More

Maximum Primes whose sum is equal to given N in C++

Narendra Kumar
Published on 21-Jan-2020 11:11:47
Problem statementGiven a positive integer N > 1. Find the maximum count of prime numbers whose sum is equal to given NExampleIf N = 8 then answer will be 4 as − 2 + 2 + 2 + 2 = 8AlgorithmFor maximum number of primes whose sum is equal to ... Read More

How to Find the List of Daemon Processes and Zombie Processes in Linux

karthikeya Boyini
Published on 21-Jan-2020 11:06:24
This article will guide you to understand the Zombie process and Daemons, and also help us to find the process which is running in the background.What is Zombie Process?When a process ends the execution, then it will have an exit status to report to its master process. Because of that ... Read More

Maximum prefix-sum for a given range in C++

Narendra Kumar
Published on 21-Jan-2020 11:08:00
Problem statementGiven an array of n integers and q queries, each query having a range from l to r. Find the maximum prefix-sum for the range l – r.ExampleIf input array is arr[] = {-1, 2, 3, -5} and queries = 2 and ranges are: l = 0, r = ... Read More

Maximum possible XOR of every element in an array with another array in C++

Narendra Kumar
Published on 21-Jan-2020 11:01:01
Problem statementTwo arrays A and B consisting of N elements are given. The task is to compute the maximum possible XOR of every element in array A with array BExampleIf input arrays are: arr1[] = {1, 3, 4, 12} arr2[] = {5, 9, 5, 7} then maximum possible XOR is: ... Read More

How to Enable or Install Byobu for Terminal Management on Ubuntu 16.04

karthikeya Boyini
Published on 21-Jan-2020 10:57:59
In this article, we will learn about Byobu on the Ubuntu 16.04, Byobu which is a terminal multiplexer and easy to use, Byobu is used to have multiple windows, consoles and split panes within the windows and will also show the status badges and notifications on the terminal.To complete this ... Read More
1 2 3 4 5 6 7 ... 3176 Next
Advertisements