Sudhir sharma has Published 1206 Articles

Predefined Identifier __func__ in C

sudhir sharma

sudhir sharma

Updated on 04-Feb-2020 07:30:13

2K+ Views

Identifier is the name given to an entity in programming to identify it in the program.Generally, identifiers are created by the programmer for efficient working but there are some predefined identifiers that are inbuilt in programming. For example, cout, cin, etc.Here, we will see one of these predefined identifiers of ... Read More

Predict the winner in Coin Game in C++

sudhir sharma

sudhir sharma

Updated on 04-Feb-2020 07:23:59

239 Views

In this game, there are two players X and Y. our task is to predict who will win the game if both play optimally and X starts the game.GameIn the coin game, there are two piles with N and M number of coins. One of the players chooses any one ... Read More

Predict the winner of the game on the basis of the absolute difference of sum by selecting numbers in C++

sudhir sharma

sudhir sharma

Updated on 04-Feb-2020 07:20:06

92 Views

In this problem, we are given an array of n numbers. And there are two players X and Y. Our task is to predict the winner of the game.For player X to win the absolute difference of the sum of numbers by X and Y should be a multiple of ... Read More

Preemptive and Non-Preemptive Scheduling

sudhir sharma

sudhir sharma

Updated on 04-Feb-2020 07:17:06

13K+ Views

Preemptive Scheduling is a CPU scheduling technique that works by dividing time slots of CPU to a given process. The time slot given might be able to complete the whole process or might not be able to it. When the burst time of the process is greater than CPU cycle, ... Read More

Prefix Sum of Matrix (Or 2D Array) in C++

sudhir sharma

sudhir sharma

Updated on 04-Feb-2020 07:13:34

3K+ Views

In this problem, we are given a 2D array of integer values mat[][]. Our task is to print the prefix sum matrix of mat.Prefix sum matrix: every element of the matrix is the sum elements above and left of it. i.eprefixSum[i][j] = mat[i][j] + mat[i-1][j]...mat[0][j] + mat[i][j-1] +... mat[i][0].Let’s take ... Read More

Prefix to Infix Conversion in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 12:13:21

1K+ Views

In this problem, we are given a prefix expression. Our task is to print the infix conversion of the given expression.Prefix expression is those expressions which have operators before the operands.Example: +AB.Infix expressions are those expressions which have operators between the operands.Example: A+BInfix expression are information for human understanding, but ... Read More

Prefix to Postfix Conversion in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 12:11:32

3K+ Views

In this problem, we are given a prefix expression. Our task is to print the postfix conversion of the given expression.Prefix expression is those expressions which have operators before the operands.Example: +AB.Postfix expressions are those expressions which have operators after operands in the expressions.Example: AB/The conversion of prefix to postfix should ... Read More

Prefixes with more a than b in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 12:08:14

85 Views

In this problem, we are given string str containing only a and b and an integer N such that a string is created by appending str n times. Our task is to print the total number of substring in which the count of a’s is more than the count of ... Read More

Preorder from Inorder and Postorder traversals in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 12:04:00

1K+ Views

In this problem, we are given the inorder and postorder traversal of a binary tree. Our task is to print the postorder traversal of the tree.Let’s take an example to understand the problemInput:inorder: 16 7 21 12 1 5 9 postorder: 16 21 7 1 9 5 12 Output: preorder: ... Read More

Preorder predecessor of a Node in Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 03-Feb-2020 12:00:04

319 Views

In this problem, we are given a binary tree and a node value. Our task is to print the preorder predecessor of the node.Binary Tree is a special type of tree in which each root node can have maximum 2 child nodes.Preorder Traversal is a way to traverse nodes of the ... Read More

Advertisements