- Trending Categories
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 1862 Articles for Data Structure
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
142 Views
The problem statement says that we need to turn on a particular bit in a number. To put it simply, all we have to do is swap out a certain bit in a number for 1. Provide the same outcome if it has already been 1. You can represent an integer using binary numbers, which come in the forms of 0 and 1 where every digit represents a power of 2. Let's represent 5 in the binary numbers. The binary form of 5 will be 101 i.e.$\mathrm{2^{2} + 2^{0}= 5.}$ In this problem, a number N will ... Read More
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
170 Views
The Binomial Theorem describes how to expand an expression raised to any finite power. A binomial theorem is a powerful expansion tool that has applications in algebra, probability, and other fields. Assume we have an expression $\mathrm{(x\:+\:y)^n}$and we need to expand the expression, we can do this using the generalised equation of binomial theorem. The binomial theorem defines a binomial expression for two different terms. The general equation of binomial theorem is: $$\mathrm{(a+b)^{n}=^n{C_{r=0}}a^{n-r}b^{0}\:+\:^n{C_{r=1}}a^{n-1}b^{1\:}+\:........\:+\:^n{C_{r=n-1}}a^{1}b^{n-1}+^n{C_{r=n}}a^{0}b^{n}}$$ $$\mathrm{=n_{\sum_{r=0}}^n{C_{r}}a^{n-r}b^{r}}$$ Where we can get the value of $\mathrm{^n{C_{r}}}$ using the formula, $$\mathrm{^n{C_{r}}=\frac{n!}{(n-r)!r!}}$$[0! is always equals to 1] NOTE There ... Read More
![Rinish Patidar](https://www.tutorialspoint.com/assets/profiles/617319/profile/60_2434475-1678768874.jpg)
176 Views
The problem includes checking if the three given straight lines are concurrent or not. If all three lines in a plane pass through the same point, they are said to be concurrent. They must intersect with each other exactly at one point to be concurrent. The three concurrent lines are depicted in the above illustration. According to the above illustration, the point of intersection of any two lines should be located on the third line to be concurrent. The point of concurrence is the intersection of these lines.As everyone is aware, a straight line can be written as ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
155 Views
In this problem, we need to check whether the given number is an unsigned integer using the DFA. We need to construct the DFA using the 2D array to solve the problem. Problem statement – We have given string str of length N. By constructing the DFA, we need to check whether the str represents the unsigned integer. In the output, print ‘unsinged integer’ or ‘Not an unsinged integer’ according to whether the number is unsinged or not. Sample examples Input– str = "1729" Output– “Unsigned integer.” Explanation– As the number doesn’t contain any sign, it is an ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
109 Views
In this problem, we need to check whether we can make two strings equal by rearranging the words of the string. We will learn three different approaches to solving the problem. In the first approach, we will use a dictionary. In the second approach, we will use the sort() method, and in the third approach, we will use the counter() constructor, which is used to count the hashable objects in the python. Problem statement – We have given a str1 and str2 containing sentences. We need to check whether we can make both strings equal by rearranging the words of ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
52 Views
In this problem, we have given two arrays of strings. We need to replace array1’s values to sort array1. To replace the values of array1, we can take the GCD of the current string of array1 with any string of array2. The GCD of the string is very similar to the GCD of the number. To solve the problem, we can find a GCD string lexicographically larger than the GCD of the string at the ith index in array1 and the jth index in array2. Problem statement – We have given array1 and array2 containing the strings, and the length ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
104 Views
In this problem, we need to modify the given string by adding the value of the digit from the num string to the ASCII value of str’s character. To solve the problem, we can convert the digit character to the actual digit and add it to the ASCII value of the character. If the ASCII value becomes greater than 122, we start again from 97. Problem statement – We have given two strings of the same length equal to N. The first string, named str, contains the lowercase alphabetical characters, and the second string, named num, contains digits only. ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
48 Views
We have given an array of positive integers and need to modify each element of the array by removing the characters given the ‘hex’ string from the hexadecimal representation of the current element. To solve the problem, we can convert the current number to a hexadecimal number. After that, we can remove the characters from the hexadecimal string, which are common in ‘hex’ and the current hexadecimal string. After modifying the hexadecimal string, we can convert it back to decimal. Problem statement – We have given an array containing positive integers, and the array's length is N. Also, we ... Read More
![Shubham Vora](https://www.tutorialspoint.com/assets/profiles/485898/profile/60_1456867-1657516792.jpeg)
91 Views
In this problem, we have given a binary string of length 4*N, and we need to flip zeros of the binary string so that any pair of indices containing ‘1’ should not be co-prime or divisible by each other. Here, we can solve the problem by observation. The string contains 4*N characters. We can flip the N characters from the last, which are at the even index. Problem statement – We have given an integer N and a binary string of the length 4*N containing all zeros initially. We need to flip ‘0’ to ‘1’ in such a way so ... Read More
![Sonal Meenu Singh](https://www.tutorialspoint.com/assets/profiles/605896/profile/60_1123519-1677042019.jpeg)
182 Views
Introduction In this tutorial, we implement examples using C++ programming logic to reverse the alternate k characters in an input string. We define the value of k to reverse the characters in a given string. K is the number of characters to be reversed. The value of k can be anything. If the value of k is more than the total number of characters in the string we do not reverse any of the string characters. Demonstration 1 String = “tutorialspoint” K = 4 Output otutrialiopsnt In the above demonstration, we consider a string “tutorialspoint” to ... Read More