In this problem, we are given an array. Our task is to create a program that will find maximum sum subarray removing at most one element in c++.Basically, we need to find one element which when removed provides the maximum sum for the elements remaining in the array.Let’s take an example to understand the problem, Input − array = {5, 1, 9, 2, -1, 7}Output − 24Explanation − we have removed -1 from the array and the sum became the maximum of all possible outcomes.One solution to this problem will be finding the minimum element of the array and then ... Read More
In this problem, we are given an array of n integers. Our task is to create a program that will find the maximum value of |arr[i]-arr[j]| + |i-j|.Let’s take an example to understand the problem, Input − array = {4, 1, 2}Output − 4Explanation −|arr[0] - arr[1]|+|0-1| = |4-1| + |-1| = 3+1 = 4 |arr[0] - arr[2]|+|0-2| = |4-2| + |-2| = 2+2 = 4 |arr[1] - arr[2 ]|+|1-2| = |1-2| + |1-2| = 1+1 = 2To solve this problem, a simple approach will be using the brute force approach which will be using two loops and finding the ... Read More
In this problem, we are given an array of positive integers and a number k. Our task is to create a program that will find the maximum sum of two nonoverlapping subarrays of the given size(k).So, basically we have two print two non-overlapping (distinct) subarrays that have the maximum sum and are of size k.Let’s take an example to understand the problem, Input −array = {7, 1, 6, 9, 2} , k = 2Output −{7, 1} , {6, 9}Explanation −all subarrays of size 2. {7, 1} : sum = 7+1 = 8 {1, 6} : sum = 1+6 = 7 ... Read More
In this problem, we are given an array of integers and a integers K. our task is to create a program that will find the maximum unique element in every subarray of size K with no duplicates.Let’s take an example to understand the problem, Input −array = {4, 1, 1, 3, 3} k = 3Output −4 3 1Explanation −Sub-array of size 3 Subarray {4, 1, 1}, max = 4 Subarray {1, 1, 3}, max = 3 Subarray {1, 3, 3}, max = 1To solve this problem, one simple method is to run two loops and create subarrays and find distinct ... Read More
Tag identification layer of Electronic Product Code (EPC) Gen 2 lays down the method by which the readers can receive the identifiers from the tags. EPC Gen 2 (second generation) RFID (Radio Frequency Identification) network has two main components, tags and readers. RFID tags are affixed on objects with EPC encoded on them for identification. EPC helps to check identities of objects like inventory, assets and people, and track them. Readers are the intelligent part of the system that tracks the tags. The tag identification layer addresses the multiple access problem of getting messages from unknown number of tags.Working PrincipleIn ... Read More
In this problem, we are given an array of n integers of range [1, n]. Our task is to create a program that will find the maximum value of |arr[0] – arr[1] - + |arr[1] – arr[2] - + … +|arr[n – 2] – arr[n – 1].Let’s take an example to understand the problem, Input − array= {1, 2, 3}Output − 3Explanation −max sum is |1-3|+|2-1| = 3To solve this problem, a simple approach is to create all permutations from the array. And find the maximum value of all the values from permutation. A more effective method is to generalize ... Read More
Backscatter is a method that uses an incident radio-frequency (RF) signal to transmit data without a battery or power source. It employs passive reflection and modulation of the incoming RF signal, and converts it into tens or hundreds of microwatts of electricity, that can be encoded for data communications.It differs from other wireless communications since the communication is half duplex in nature, i.e. both the sender and receiver cannot transmit simultaneously. The mains advantage of backscattering is that it’s low energy requirements and low complexity of deployment.Architecture of backscatter communicationsA basic backscatter communication system has two main components: tags, and ... Read More
In this problem, we are given an array of n elements. Our task is to create a program that will find the maximum value of arr[i]%arr[j] for a given array.So, basically we need to find the value of the maximum remainder while dividing two elements of the array.Let’s take an example to understand the problem, Input − array{3, 6, 9, 2, 1}Output − 6Explanation −3%3 = 0; 3%6 = 3; 3%9 = 3; 3%2 = 1; 3%1 = 0 6%3 = 0; 6%6 = 0; 6%9 = 6; 6%2 = 0; 6%1 =0 9%3 = 0; 9%6 = 3; 9%9 ... Read More
Physical layer of Electronic Product Code (EPC) Gen 2 defines method of transmission of bits across the network. EPC is a universal identifier encoded on RFID (Radio Frequency Identification) tags to check identities of objects like inventory, assets and people, and track them. The second generation of this technology, as laid down by EPCglobal Tag Data Standard, is called EPC Gen 2.EPC Gen 2 RFID network has two main components, tags and readers. Tags are affixed on objects that enables them to be identified or tracked. Readers are the intelligent part of the system that tracks the tags. The physical ... Read More
In this problem, we are given an array of integers. Our task is to create the maximum value of XOR among all triplets of an array.Let’s take an example to understand the problem, Input − array = {5, 6, 1, 2}Output − 6Explanation −All triplets are: 5^6^1 = 2 5^6^2 = 1 5^1^2 = 6 6^1^2 = 5To solve this problem, a direct approach will be to find the XOR of all possible triplets and print the maximum of all triplets. This will not be effective if we work with an array with a huge number of elements in the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP