 
 Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Server Side Programming Articles - Page 1317 of 2650
 
 
			
			302 Views
Given two numbers start and end as range variables. The goal is to find the count of numbers that lie in this range [start, end] and have a difference of sum of digits at even and sum of digits at odd positions as Prime.That is (sum of digits at even position)-(sum of digits at odd position) = a Prime numberLet us understand with examples.For ExampleInput - start = 230, end = 270Output - Count of Numbers in Range with difference between Sum of digits at even and odd positions as Prime are: 6Explanation - The number(s) between 230 to 270 ... Read More
 
 
			
			189 Views
Given two numbers start and end as range variables and an integer q as input. The goal is to find the numbers within a range such that the number and its product with q have no common digits.If the number is 5 and q is 3 then the product will be 15. Both 5 and 15 have a common digit 5.If the number is 2 and q is 5 then the product will be 10. Both 2 and 10 have no common digit.Let us understand with examples.For ExampleInput - start = 5, end = 10, q = 2Output - Count ... Read More
 
 
			
			554 Views
Given a Maze represented as a row X col matrix in which the obstacle is represented as -1 and a clear cell has value other than -1. The goal is to start from the first cell arr[0][0] and reach the last cell arr[row][col] such that only two moves are allowed:Right move arr[i][j] to arr[i][j+1] and Down move arr[i][j] to arr[i+1][j].Let us understand with examples.Input - arr[row][col] = {{0, 0, 0}, {-1, -1, 0}, {0, 0, 0}}Output - Count of number of ways to reach destination in a Maze are: 1Explanation 0 1 2 0 0 ... Read More
 
 
			
			190 Views
Given a square matrix[][] containing non negative numbers as its elements. Also given a variable score. The goal is to count the ways to reach the given score by adding elements from matrix[][] such that only moves allowed are right moves and down moves. Starting from matrix[0][0] only moves can be, move to matrix[0][1] ( right move ) or move to matrix[1][0] ( down move ) and add value to reach sum=score.Let us understand with examples.For ExampleInput - matrix[row][col] = { {1, 1}, { 1, 1} } score=3Output - Count of number of ways to reach a given score in a ... Read More
 
 
			
			298 Views
We are given a string and a range starting from start till end and the task is to calculate the count of palindromic substring present in a given range. Palindrome strings are those strings which are similar from forward and backward of a string like nitin, aba, etc.For ExampleInput - InputString = "cccaabbbdee", start = 2, end = 6;Output - Count of Palindromic substrings in an Index range 7Explanation - we are given with a range and a string so, we will start traversing the string from the start pointer which is 2 i.e. 'c' till 6 i.e. 'b' therefore the substring is ... Read More
 
 
			
			2K+ Views
In this tutorial, we are going to write a program that creates a new linked list from the given linked lists.We have given two linked lists of the same size and we have to create a new linked list from the two linked lists with the max numbers from the two linked lists.Let's see the steps to solve the problem.Write a struct node.Create two linked lists of the same size.Iterate over the linked list.Find the max number from the two linked lists nodes.Create a new node with the max number.Add the new node to the new linked list.Print the new ... Read More
 
 
			
			28K+ Views
In this tutorial, we are going to learn how to create a linked list from the given array.Let's see the steps to solve the problem.Initialize the array with dummy data.Write the struct node.Iterate over the array.Create a new node with the data.Insert the new node into the linked list.Print the linked list.ExampleLet's see the code.#include using namespace std; struct Node { int data; Node* next; }; struct Node* newNode(int data) { Node* node = new Node; node->data = data; node->next = NULL; return node; } void insertNewNode(Node** root, int data) { Node* ... Read More
 
 
			
			157 Views
In this tutorial, we are going to write a program that creates a new string by alternately combining the characters of the two halves of the string in reverse order.Let's see the steps to solve the problem.Initialize the string.Find the length of the string.Store the first half and second half string indexes.Iterate from the ending of the two halves of the string.Add each character to the new string.Print the new string.ExampleLet's see the code. Live Demo#include using namespace std; void getANewString(string str) { int str_length = str.length(); int first_half_index = str_length / 2, second_half_index = str_length; string ... Read More
 
 
			
			2K+ Views
In this tutorial, we are going to reflect the given binary tree.Let's see the steps to solve the problem.Write a struct node.Create the binary tree with dummy data.Write a recursive function to find the mirror of the given binary tree.Recursively call the function with left and right nodes.Swap the left node data with the right node data.Print the tree.ExampleLet's see the code. Live Demo#include using namespace std; struct Node { int data; struct Node* left; struct Node* right; }; struct Node* newNode(int data) { struct Node* node = new Node; node->data = data; node->left = ... Read More
 
 
			
			2K+ Views
In this tutorial, we are going to write a program that creates a new linked list from the given linked lists.We have given two linked lists of the same size and we have to create a new linked list from the two linked lists with the max numbers from the two linked lists.Let's see the steps to solve the problem.Write a struct node.Create two linked lists of the same size.Iterate over the linked list.Find the max number from the two linked lists nodes.Create a new node with the max number.Add the new node to the new linked list.Print the new ... Read More