Sudhir sharma has Published 1206 Articles

Sum of the elements from index L to R in an array when arr[i] = i * (-1)^i in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 08:12:58

296 Views

In this problem, we are given two numbers L and R. We also have an array arr[] such that arr[i] = i*(-1)^i. Our task is to create a program to calculate the sum of the element from index L to R in an array when arr[i] = i*(-1)^i.So, we need ... Read More

Sum of the digits of a number N written in all bases from 2 to N/2 in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 08:10:56

112 Views

In this problem, we are given a number N. Our task is to create a program to find the sum of the digits of the number N in bases from 2 to N/2.So, we have to convert the base of the number to all bases from 2 to N/2 i.e. ... Read More

Sum of the alternate nodes of linked list in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 08:08:29

432 Views

In this problem, we are given a linked list. Our task is to print the sum of alternate nodes of the linked list.Linked list is a sequence of data structure which are connected together via links.Now, let’s get back to the problem. Here, we will add alternate nodes of the ... Read More

Sum of the alphabetical values of the characters of a string in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 08:05:11

1K+ Views

In this problem, we are given an array of string str[]. Our task is to find the score of all strings in the array. The score is defined as the product of the position of the string with the sum of the alphabetical values of the characters of the string.Let’s ... Read More

Bessel’s Interpolation in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 08:01:38

1K+ Views

Interpolation is a type of estimation technique of unknown value which lies between know values. Interpolation is the process of constructing new data points between the range of a discrete set of know data points.An application or reason to use interpolation is that it might reduce computation costs. When the ... Read More

Back-off Algorithm for CSMA/CD

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 07:58:20

4K+ Views

Back Off Algorithm is an algorithm used for collision resolution. It works as, When this collision occurs, both the devices wait for a random amount of time before retransmitting the signal again, they keep on trying until the data is transferred successfully. This is called back off, since the nodes ... Read More

Asynchronous Functions and the Node Event Loop in Javascript

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 07:54:48

114 Views

Asynchronous Functions, the programs continue to run. It does not wait! This way the waiting time of the user is reduced. Also, Javascript as a programming language itself is asynchronous.For example, if in code we are running an expensive request, which might require a lot of time, then in case ... Read More

Alexander Bogomolny’s UnOrdered Permutation Algorithm in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 07:53:40

165 Views

Here, we are given a number N. Our task is to find unorder permutation of N using Alexander Bogomolny’s UnOrdered Permutation Algorithm.Let’s discuss permutation first, A permutation is the number of ways an item in a set can be uniquely ordered is called a permutation.Example − Permutation of {4, 9, ... Read More

Aho-Corasick Algorithm for Pattern Searching in C++

sudhir sharma

sudhir sharma

Updated on 06-Aug-2020 07:51:00

632 Views

In this problem, we are given an input string and an array arr[]. Our task is to find all occurrences of all words of the array in the string. For this, we will be using the Aho-Corasick Algorithm for Pattern Searching.String and pattern searching is an important thing in programming. ... Read More

Sum of first N natural numbers which are divisible by 2 and 7 in C++

sudhir sharma

sudhir sharma

Updated on 05-Aug-2020 08:20:00

110 Views

In this problem, we are given a number N. Our task is to find the sum of first N natural numbers which are divisible by 2 and 7.So, here we will be given a number N, the program will find the sum of numbers between 1 to N that is ... Read More

Advertisements