- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 27154 Articles for Server Side Programming
91 Views
The aim of this article is to implement a program to obtain the count of sum of “10” subsequences for each 1 in string with A 1s, B 10s and C 0s. Example Let us take the Input: A = 1, B = 2, C = 3 Output obtained here is : 14 Explanation A = 1 denotes. There is a single "1" string, B = 2 denotes, there is a pair of "10" strings, and C = 3 denotes, there is a trio of "0" strings. The string that results from concatenation is "11010000". Five ... Read More
81 Views
The aim of this article is to implement a program to convert a string Str1 to Str2 by moving B to right and A to left without crossover. As we know, a string is a group of characters that ends with the null character "\0" in C programming. Characters from the C String are kept in a character array. A C string differs from a character array in that it ends with the distinctive character "\0". Example Let us take the input strings, str1 = “#B#A#”, and str2 = “##BA#” Output obtained here is: Yes Explanation − 'B' ... Read More
50 Views
The aim of this article is to implement a program C++ program to check if all rows of a matrix are circular rotations of each other. Here is a small glimpse on what a matrix exactly is. The rectangular array of symbols or numbers organized in rows and columns is known as a matrix. A matrix can be of many distinct types, including row, column, horizontal, vertical, square, diagonal, identity, equal, and singular. Addition, subtraction, as well as multiplication are the three fundamental matrix operations. The goal is to determine whether all rows of a matrix of size n*n ... Read More
220 Views
The aim of this article is to implement a program C Program To Write Your Own atoi(). Before we begin, let us take a deeper understanding of what an atoi() function is all about. This will help in writing the program as well as understanding the concepts pretty much easier. To the ones who are not much aware of what an atoi() function is. Here you go. The atoi() function changes a string of elements into an integer value. The string that is entered is a string of characters that has the potential to become a numeric value of the ... Read More
58 Views
The aim of this article is to implement a program to minimize a given number by swapping adjacent digits with odd differences. The goal is to determine the lowest amount that can be created from a string of size N indicating an integer using only the characters '1', '2', and '3' by exchanging adjacent characters any number of times. As we all know, a string is a group of characters that ends with the null character "0" in C programming. Characters from the C String are kept in a character array. A C string differs from a character array in ... Read More
84 Views
The aim of this article is to implement a program to check if a given String is K-periodic for all K in range [1, N]. The aim is to determine whether the supplied string is K-periodic provided the string s and the integer K. If a string repeats the sub-string str[0... k-1], it is said to be k-periodic; for example, the string "ababab" is 2 periods long. Print Yes if the supplied string is k-periodic; otherwise, print No. If a character string can be created by concatenating at least one repeats from another string of length k, it is said ... Read More
65 Views
The aim of this article is to implement a C++ Program to Find Lexicographically minimum string rotation. Coming on to the definition of string, a string is a group of characters that ends with the null character "0" in C programming. Characters from the C String are kept in a character array. A C string differs from a character array in that it ends with the distinctive character "\0." Finding the rotation of a string that has the lowest lexicographical order among all feasible rotations is known to be the lexicographically minimal string rotation as well as lexicographically smallest circular ... Read More
96 Views
Problems involving grids and matrices are mostly solved using either BFS or DFS traversal algorithms. Taking a look into the first one, Breadth First Traversal − BFS or Breadth First Traversal is an algorithm for searching a tree or a graph data structure. It starts at the root node and explores all the nodes at the present level before moving on to the next level. Algorithm procedure BFS(G, root) is let Q be a queue label root as explored Q.enqueue(root) while Q is not empty do ... Read More
116 Views
Reducing an array to a single element by repeatedly removing element is done by the following criteria − Select indices i and j such that i < j and arr[i] < arr[j] and convert one of the two elements to 0. Problem Statement Given an array arr[] containing positive integers. Find if the array can be reduced to a single element by repeatedly removing an element from any increasing pair. If possible return true along with the indices chosen and the index of the element that is removed. Sample Example 1 Input arr[] = {5, 7, 10, 2, 4, ... Read More
49 Views
Recurrence Relation − In mathematics, recurrence relation refers to an equation where the nth term of the sequence is equal to some combination of the previous terms. For a recurrence relation where each term equals the product of previous K terms, let’s define N and K along with an array arr[] containing the first K terms of the relation. Thus, the nth term is given by − $$\mathrm{F_N= F_{N−1} ∗ F_{N−2} ∗ F_{N−3} ∗ . . .∗ F_{N−K}}$$ Problem Statement Given two positive integers N and K and an array of integers containing K positive integers. Find the Nth term ... Read More