Sudhir sharma has Published 1206 Articles

Write a C program to print “ Tutorials Point ” without using a semicolon

sudhir sharma

sudhir sharma

Updated on 01-Jul-2020 11:29:03

169 Views

To print any string without using a semicolon we need to find how the standard output work and why is semicolon used.The semicolon is a end of line statement that is used to tell the program that the line is ended here. The standard print statement printf used here is ... Read More

Sum of first n natural numbers in C Program

sudhir sharma

sudhir sharma

Updated on 01-Jul-2020 11:08:28

1K+ Views

The concept of finding the sum of sum of integers is found such that first, we will find the sum of numbers up to n and then add all the sums to get a value which will be the sum of sum which is our desired sum.For this problem, we ... Read More

Program to calculate Bitonicity of an Array

sudhir sharma

sudhir sharma

Updated on 01-Jul-2020 06:07:18

69 Views

The bitonicity of an array is defined using the following syntax −To find bitonicity of an array based on its elements is −Bitonicity = 0 , initially arr[0] i from 0 to n Bitonicity = Bitonicity+1 ; if arr[i] > arr[i-1] Bitonicity = Bitonicity-1 ; if arr[i] < arr[i-1] Bitonicity ... Read More

Advanced master theorem for divide and conquer recurrences

sudhir sharma

sudhir sharma

Updated on 08-Jun-2020 05:44:13

2K+ Views

Divide and conquer is an algorithm that works on the paradigm based on recursively branching problem into multiple sub-problems of similar type that can be solved easily.ExampleLet’s take an example to learn more about the divide and conquer technique −function recursive(input x size n)    if(n < k)     ... Read More

XOR of all Prime numbers in an Array in C++

sudhir sharma

sudhir sharma

Updated on 20-Apr-2020 11:57:01

219 Views

In this problem, we are given an array of n elements. Our task is to print xor of all prime numbers of the array.Let’s take an example to understand the problem, Input − {2, 6, 8, 9, 11}Output −To solve this problem, we will find all the prime numbers of ... Read More

XOR of all subarray XORs in C++

sudhir sharma

sudhir sharma

Updated on 20-Apr-2020 11:55:42

361 Views

In this problem, we are given an array of n elements. Our task is to print XOR of XORs all possible subarrays (taken in order) created from elements of the array.Let’s take an example to understand the problem, Input − array = {1, 3, 6, 8}Output − 0Explanation −(1) ^ ... Read More

XOR of all the elements in the given range [L, R] in C++

sudhir sharma

sudhir sharma

Updated on 20-Apr-2020 11:54:06

559 Views

In this problem, we are given two integer L and R denoting a range. Our task is to find xor of all elements within the range [L, R].Let’s take an example to understand the problem, Input − L=3, R = 6Explanation − 3^4^5^6 =To solve this problem, we will find ... Read More

XOR of all the nodes in the sub-tree of the given node in C++

sudhir sharma

sudhir sharma

Updated on 20-Apr-2020 11:50:50

217 Views

In this problem, we are given an n tree and there are some queries that are nodes of the tree. Our task is to print the XOR of all nodes of the sub-tree formed by the given node.Let’s take an example to understand the problem, Queries − {1, 6, 5}Output ... Read More

XOR of numbers that appeared even number of times in given Range in C++

sudhir sharma

sudhir sharma

Updated on 20-Apr-2020 11:48:19

72 Views

In this problem, we are given an array of n elements and there are some queries which are range from a start point to endpoint in the array. Our task is two finds the XOR of elements that appeared even a number of times in the range.Let’s take an example ... Read More

XOR of the path between any two nodes in a Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 20-Apr-2020 11:45:21

238 Views

In this problem, we are given a binary tree and two nodes of the binary tree. Our task is to print the XOR of all nodes that come in the path between the two nodes.Let’s take an example to understand the problem, We need to find the xor of all ... Read More

Advertisements