Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Articles on Trending Technologies
Technical articles with clear explanations and examples
Find the only element that appears b times using C++
In this problem, we are given an arr[] of size n and two integers a and b. Our task is to find the only element that appears b times.All values of the array occur a time except one value which occurs b times in the array and we need to find that value.Let’s take an example to understand the problem, Inputarr[] = {3, 3, 3, 3, 5, 5, 5, 1, 1, 1, 1} a = 4, b = 3Output5Solution ApproachA simple solution to the problem is by counting the occurrence of each element and then storing it in a 2D ...
Read MoreWhat are Single-Attribute Evaluators in data mining?
In single-attribute evaluators, it can be utilized with the Ranker search methods to make a ranked list from which ranker discards a given number. It is also used in the RankSearch method.Relief Attribute Eval is instance-based − It samples instances randomly and checks neighboring instances of the equal and multiple classes. It works on discrete and continuous class data. Parameters define the multiple instances to sample, the various neighbors to check, whether to weight neighbors by distance, and an exponential function that conducts how increasingly weights decay with distance.InfoGain Attribute Eval − It computes attributes by calculating their information gain ...
Read MoreFind the only different element in an array using C++
In this problem, we are given an arr[] of size n. Our task is to find the only different element in an array.There are only two different types of elements in the array. All the elements are the same except one.Let’s take an example to understand the problem, Inputarr[] = {1, 1, 1, 2, 1, 1, 1, 1}Output2Solution ApproachA simple approach to solve the problem, we need to traverse the array and find elements which are different from other elements of the array. This approach needs a time complexity of O(N2).Another approach to solve the problem in O(N) is by ...
Read MoreWhat is Bias–Variance Decomposition?
The effect of joining multiple hypotheses can be checked through a theoretical device called the bias-variance decomposition. Suppose it can have an infinite number of separate training sets of similar size and use them to create an infinite number of classifiers.A test instance is treated by all classifiers, and an individual answer is decided by bulk vote. In this situation, errors will appear because no learning design is perfect. The error rate will be based on how well the machine learning approaches connect the problem at hand, and there is also the effect of noise in the record, which cannot ...
Read MorePlant Capacity Factor, Plant Use Factor, and Units Generated per Annum
Units Generated per AnnumThe kWh generated per annum or the energy generated per annum by a power station is determined as follows −$$\mathrm{\because Load\: factor\:=\:\frac{Average\: load}{Maximum\: demand}}$$$$\mathrm{\therefore Average\: load\:=\:Maximum\: demand\:\times \:Load\: factor}$$Hence, the units generated per annum is given by, $$\mathrm{Units\: generated \:per \:annum\:=\:Average\: load \:in\: kW\:\times \:Hours \:in\: a\: year}$$$$\mathrm{=\:Maximum\: demand\: in\: kW\:\times \:Load\: factor\:\times\: 8760}$$$$\mathrm{\Rightarrow Units\: generated\: per\: annum\:=\:Maximum\: demand \:in\: kW\:\times \:Load\: factor\:\times \:8760}$$Plant Capacity FactorThe plant capacity factor of a power station is defined as the ratio of actual energy produced to the maximum possible energy that could have been produced during a given period, i.e., ...
Read MoreFind the one missing number in range using C++
In this problem, we are given an arr[] of size n. Our task is to find the one missing number in range.The array consists of all values ranging from smallest value to (smallest + n). One element of the range is missing from the array. And we need to find this missing value.Let’s take an example to understand the problem, Inputarr[] = {4, 8, 5, 7}Output6Solution ApproachA simple solution to the problem is by searching the missing element by sorting the array and then finding the first element of range starting from minimum value which is not present in the ...
Read MoreMaximum occurring character in an input string using C++
In this problem, we are given an input string of lowercase characters. Our task is to maximum occurring character in an input string.In case of multiple values with the same frequency of occurrence, we need to print lexicographically smaller values.Let’s take an example to understand the problem, Inputstring = “programming”OutputgSolution ApproachTo find the solution to the problem, we need to sort the read string and then traverse the string so that we could find the character which has maximum occurrence in the string. We would use hashing method (hash table method) to conquer this problem. Traversing and hashing the each ...
Read MoreFind the number of zeroes using C++
In this problem, we are given a binary array bin[] consisting of only 0’s and 1’s. Our task is to find the number of zeroes.The array is sorted i.e. all 0’s are arranged together after 1’s.Let’s take an example to understand the problem, Inputarr[] = {1, 1, 1, 0, 0, 0, 0}Output4Solution ApproachA simple solution to the problem is using the fact that the array is sorted, that is the number of 0’s in the array can be found using the first occurrence of 0 in the array. As after the first occurrence all values will be zero.For finding the ...
Read MoreFind the number of solutions to the given equation in C++
In this problem, we are given three integer values A, B, C. Our task is to find the number of solutions to the given equation.EquationX = B*Sm(X)^A + Cwhere Sm(X) is the sum of digits of X.We need to count all the values of X such that it satisfies the above equation where X can be any number between 1 to 109.Let’s take an example to understand the problem, InputA = 3, B = 6, C = 4Output3Solution ApproachA solution to solve the problem is by counting the number of values of X. For this, the sum of digits plays ...
Read MoreWhat are the five main sources of electrical energy?
Sources of EnergyThe electrical energy is obtained from energy available in the various forms in the nature. The main sources of energy used to generate electrical energy are −The SunThe Sun is the main source of energy. The heat energy radiated by the Sun is to be focused over a small area with the help of reflectors. Then, this heat energy can be used to produce steam and the steam energy can be used to drive the turbine, which in turn drives an alternator to generate electrical energy.This method of generating electrical energy has limited applications because −It requires a ...
Read More