Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
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 328 of 2650
748 Views
A string may be composed of several words. Every word in a C++ string may contain letters, numbers or special symbols. Strings are considered to be storage elements for these kind of characters. Each word is separated by a space character. Each word also forms a string of characters. Reverse of any string in C++ is the string follows the following points − It is formed by taking characters from the end towards the beginning. The length of the original string remains unchanged. The order of occurrence of characters in a string can be reversed easily by swapping ... Read More
169 Views
A string is a sequence of characters, numbers, Alphanumeric characters and special characters. The length of a string is the number of characters that are present in it. A prime number is the number which is divisible by 1 and the number itself. In this artice, we are given a sample input string of length n. We are going to develop a code where the idea is to substitute the same character at any position p, such that the the characters at positions ranging from 1 to n/p should coincide. Some of the examples illustrating the problem statement ... Read More
794 Views
Every string is formed by a sequence of characters arranged in an order. The string may be composed of letters, number or even special characters. An anagram of any input string, is the string with a random permutation of characters. This implies, that when the order of the characters is rearranged, an anagram of the string is obtained. The respective counts of the characters should also remain the same in anagrams. Two anagram strings have the following implications − Both of them contains the same set of characters. Both of them may have a different permutation of characters ... Read More
327 Views
A binary string in any programming language is a collection of characters, 0 and 1. At every stage, the binary string follows the approach that the string can contain only these two characters. Consecutive characters in strings are the characters such that the difference in indices is 1. Let us consider two indices, i and j , they are said to be consecutive, if |j-i| = 1. Two strings in C++ are said to be equivalent if − The corresponding characters in both the strings are same. The length of the strings are equal as well as the characters ... Read More
857 Views
A string is a sequence of characters, numbers and special characters. A string may contain multiple substrings. A substring of a given string is any sequence of characters taken in order. It must satisfy the following properties All the characters should be taken from the input string The indexes taken from the original string should be contiguous. The characters can’t be skipped from between. It may eliminate characters from the original string. All the characters taken from a particular string should be consecutive in nature. However, each substring may be composed of same or different characters. In this ... Read More
783 Views
A binary string is a sequence of characters comprising of 0’s and 1’s only. A binary string can’t contain any other character. Some of the examples of binary strings are “0000”, ”01010” or “11111” A substring of a given string is a sequence of characters taken in order. A string may contain multiple substrings. Non-overlapping strings are the strings where the indices of any two found substrings should not collide with each other. This implies that for any two substrings substr1[a..b] and substr2[c..d], either of the following, bd should be true. The problem statement involves the computation of the ... Read More
606 Views
A string is a continuous stream of characters, numbers. It may even contain special characters. An string can be composed of multiple sub-strings, also referred by words. A permutation of a string is another string composed of the same set of characters, possibly arranged in a different order. It can basically be considered as a reordering of the string letters. For instance, abcd and badc are the permutations of the same string. Sample Examples Example 1 : str : “Permutation” arr : {“repuio”, ”mat”, “mtatn”, ”mutate”} Output :Yes The input string “Permutation” can be formed from the pair strings at ... Read More
197 Views
Our objective to compute power of power k time % m, with the values of base, k and m provided as input − Look at the image above. Have you ever tried to compute such a problem? Let’s try it. Compute the power of power k times and then find modulo with m. Explanation In this question, x, k, and m are given. Compute ${x^{x{^x{^{^.{^{^.{^{^.}}}}}}}}}$ up to k times and then modulo with m. Let’s understand with an example. Given, x = 2, k = 4, and m = 6 So, Compute $2^{2^{2{^2}}}\:=\:4^{2{^2}}\:=\:16^2\:=\:256$ Then 256 % 6 ... Read More
334 Views
From the problem statement, we can understand that given two arrays, we have to check whether the first array can fit into the second array. In the real world, there are many instances where we need to check whether an array can fit into another array by rearranging the elements in the array. For a variety of reasons, programmers may need to reorder the items of an array to see if they can fit into another array. Memory management in computer programming is one such reason. When working with huge amounts of data, it is frequently more effective to use ... Read More
10K+ Views
Let us first understand some basic concepts and equations based on which the projectile motion can be modelled. The figure shown below explains some basic terminologies of projectile motion. Here, "u" is the velocity with which the projectile is being projected. 𝛼 is the angle of projection of the projectile. The path taken up by the projectile during its flight. Range is the maximum horizontal distance travelled by the projectile. $\mathrm{h_{max}}$ is the maximum height attained by the projectile. Moreover, the time taken up by the projectile to travel the range is called as time of flight. The projectile ... Read More