Elo Rating Algorithm in C++

sudhir sharma
Updated on 22-Jan-2021 12:48:13

632 Views

Elo Rating Algorithm is a rating algorithm used to rank players in competitive games. The ranking of player of the competition is based on ranting which changes based on the performance of the player as follows, For a game between two players of different ratings. Let’s say there are two players competing against each other−Player1                          Player2Rating of player1 is greater than player2.If player1 wins the game some player will be transferred from player1 to player2 and vice versa if player2 wins.But the amount of rating to be transferred for victory ... Read More

Elements to Add for Complete Range in Array in C++

sudhir sharma
Updated on 22-Jan-2021 12:40:32

116 Views

In this problem, we are given an array arr[] consisting of n number. Our task is to create a program to find the number of elements to be added so that all elements of a range are present in array. Problem Description: Here, we need to find the number of elements that are needed to be added to the array to make sure that all elements of a range are present in the array. The range is from smallestElement of array to largestElement of array. Let’s take an example to understand the problem, Input: arr[] = {5, 8, 3, 1, 6, 2}Output: 2Explanation:The range is from ... Read More

Elements of an Array Not Divisible by Any Element of Another Array in C++

sudhir sharma
Updated on 22-Jan-2021 12:39:53

421 Views

In this problem, we are given two arrays arr1[] and arr2[]. Our task is to create a program to find the elements of an array that are not divisible by any element of another array. Problem Description: Here, we need to find all elements from arr1 that are not divisible by any elements of arr2.Let’s take an example to understand the problem, Input: arr1[] = {17, 15, 5, 12, 8}        arr2[] = {5, 4}Output: 17Explanation −Elements of arr1 and elements dividing them, 17 -> no element can divide it.15 -> 5 divides the element.5 -> 5 divides the element.12 -> 4 ... Read More

Elements Greater Than Previous and Next Element in Array in C++

sudhir sharma
Updated on 22-Jan-2021 12:38:53

1K+ Views

In this problem, we are given an array arr[] of n positive integers. Our task is to create a program to find the elements greater than the previous and next element in an Array. Code Description: We need to find the elements of the array that satisfy the condition, the element is greater that the element at index 1 less than it and also is greater than the element at index 1 greater than it.Let’s take an example to understand the problem, Input: arr[] = {3, 2, 5, 7, 3, 4, 5}Output: 7Explanation −Element with index one less than the current element, 5.Element with ... Read More

Easy Way to Remember Strassen's Matrix Equation in C++

sudhir sharma
Updated on 22-Jan-2021 12:36:00

795 Views

It is a matrix multiplication algorithm is based on divide and conquer method. It is used to multiply two matrices of the same size, Finding multiplication of two matrices−The strassen’s Algorithm reduces overhead for multiplication by simplifying the multiplication.Here is the multiplication made using the strassen’s Algorithm: M1 = a*(f - h) M2 = (a + b)*h M3 = (c + d)*e M4 = d*(g - e) M5 = (a + d)*(e + h) M6 = (b - d)*(g + h) M7 = (a - c)*(e + f) This can be easily remembered and the algorithm code can be decoded. For this we have a few rules, first remember these ... Read More

Editors and Its Types in System Programming in C++

sudhir sharma
Updated on 22-Jan-2021 12:35:41

5K+ Views

Editors are basically computer programs that are utilised to edit files on a computer. The provide environment to a programmer to create, edit, update, format a document in any order he/she wants to.In system programming or programming, editors are software or tools that are used to edit the program. These are basically text editors of special type that have integrated functionality to edit code.Some common program editors are notepad++, visual code, sublime. Also there are some edits that provide things used to do more than just editing the code. They are the integrated development environment (IDE) which can help you edit, debug and run ... Read More

Element Equal to the Sum of All Remaining Elements in C++

sudhir sharma
Updated on 22-Jan-2021 12:35:22

197 Views

In this problem, we are given an array arr[] consisting of n positive values. Our task is to find the element equal to the sum of all the remaining elements of the array.Code Description: We need to find the element whose value is equal to the sum of all elements of the array except that element.Let’s take an example to understand the problem, Input: arr[] = { 5, 4, 17, 1, 7 }Output: 17Explanation −The sum of the rest of the element is (5 + 4 + 1 + 7 ) = 17, which is equal to the remaining element 17.Solution Approach −A simple ... Read More

Dumpster Diving and Trashing in C++

sudhir sharma
Updated on 22-Jan-2021 12:30:06

141 Views

Dumpster diving or trashing is a technique used in cyber security and information technology which is commonly used by hackers to extract data. It is based on the fact that “something which is worthless for someone can be of great usage for someone else”. It works based on the idiom, “One man’s trash is another man’s treasure”. Trashing refers to searching online trash (unused information) and finding out fruitful information about a business or person to use it to perform hacking related activities.This dumpster diving is used to gather information to try to hack or extract information of business using a phishing technique by pretending to be ... Read More

Dudeney Numbers in C++

sudhir sharma
Updated on 22-Jan-2021 12:29:45

652 Views

A mathematical number defined in number theory in a given number base is a natural number equal to the perfect cube of another natural number such that the digit sum of the first natural number is equal to the digit sum of the second number(wikipedia).The number was found by Henry Dudeney. Its mathematical formula is −Here, we are given an integer n. Our task is to check whether the given number n is a dudeney number or not. Let’s take an example to understand the problem, Input: N = 17592Output: NoExplanation:  The given number is not a dudney number.Solution Approach −The solution lies ... Read More

Dual Mode Operations in OS in C++

sudhir sharma
Updated on 22-Jan-2021 12:29:14

3K+ Views

Every system works on operations mainly in two modes to safeguard hardware’s computation. The two modes are −User ModeKernel ModeUser Mode −The OS mode in which all the user applications and programs will run. Here, the user instructions are worked on and softwares like playing music is run.Kernel Mode −The OS mode in which the hardware loads and its computations are performed. Only privileged instructions are allowed to run in kernel mode. Some common privileged instructions are −Input-Output ManagementSwitching modes between user mode and kernel mode.Interrupt managementDual Mode in OS is the switching of modes between the two modes and switching of mode ... Read More

Advertisements