Sudhir sharma has Published 951 Articles

Add all greater values to every node in a given BST?

sudhir sharma

sudhir sharma

Updated on 01-Jul-2020 14:57:28

292 Views

A BST or binary search tree is a form of binary tree that has all left nodes smaller and all right nodes greater than the root value. For this problem, we will take a binary tree and add all the values greater than the current node to it. the problem ... Read More

C Program to Multiply two Floating Point Numbers?

sudhir sharma

sudhir sharma

Updated on 01-Jul-2020 11:36:53

846 Views

Float is a shortened term for "floating-point." By definition, it's a fundamental data type built into the compiler that's used to define numeric values with floating decimal points. A floating-point type variable is a variable that can hold a real number, such as 4320.0, -3.33, or 0.01226. The floating part ... Read More

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

sudhir sharma

sudhir sharma

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

316 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

139 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

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

sudhir sharma

sudhir sharma

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

299 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

531 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

717 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

343 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 the path between any two nodes in a Binary Tree in C++

sudhir sharma

sudhir sharma

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

369 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