- 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
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
159 Views
In this article, we delve into an interesting problem from the world of binary string manipulation: "Check if a given number contains only '01' and '10' as substrings in its binary representation". This problem challenges us to verify whether a number's binary representation contains only the substrings '01' and '10'. We'll discuss the problem in detail, offer a C++ code implementation, and illustrate the concept with an example. Understanding the Problem Statement Given a number, the task is to check if its binary representation contains only '01' and '10' as substrings. In other words, we need to verify if the ... Read More
![Mithlesh Upadhyay](https://www.tutorialspoint.com/assets/profiles/655330/profile/60_3996324-1684216489.jpg)
9K+ Views
In this article, we will discuss multilevel indexes in RDBMS, their types, and examples. In Relational Database Management Systems (RDBMS), indexes are essential data structures that allow faster data retrieval by reducing the number of disk accesses required to retrieve data. But, traditional indexes can become inefficient as the database size grows. Multilevel indexes provide a solution to this problem by dividing the index into smaller, manageable pieces. Indexing Indexing helps to optimize the performance of a database. It minimizes the number of disk accesses required when a query is processed. It is a data structure technique which is used ... Read More
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
85 Views
In this article, we will discuss how to check if the characters of each word in a given string can be rearranged to form an Arithmetic Progression (AP). We will also implement the solution in C++ and provide an example to illustrate the working of the code. Arithmetic Progression (AP) An Arithmetic Progression (AP) is a sequence of numbers in which each term after the first is obtained by adding a constant d to the preceding term. The constant d is called the common difference. For example, the sequence 1, 3, 5, 7, 9 is an Arithmetic Progression with common ... Read More
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
160 Views
In this article, we'll delve into an intriguing problem in the field of string manipulation: how to check if the characters of a given string can be made non-decreasing by replacing '?' characters. This problem provides an excellent opportunity to hone your skills in string manipulation and condition checking in C++. Problem Statement Given a string consisting of alphabetic characters and question marks (?), determine whether the characters can be made non-decreasing by replacing the '?'s. The non-decreasing condition means that for every two adjacent characters in the string, the ASCII value of the second character is not less than ... Read More
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
85 Views
In this article, we will explore the problem of checking whether all strings of an array can be made the same by interchanging characters. We will first understand the problem statement and then investigate both the naive and efficient approaches to solve this problem, along with their respective algorithms and time complexities. Lastly, we will implement the solution in C++. Problem Statement Given an array of strings, determine if all strings can be made the same by interchanging characters. Naive Approach The naive approach is to sort the characters of each string in the array and then compare each sorted ... Read More
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
3K+ Views
In computer science, hexadecimal is a base-16 number system. It uses 16 distinct symbols, including the ten decimal digits from 0 to 9 and the six letters A, B, C, D, E, and F to represent numbers from 0 to 15. In this article, we will discuss how to check if a string represents a hexadecimal number or not. Problem Statement Given a string, the task is to check if it represents a valid hexadecimal number or not. Approach We can solve this problem by iterating over the characters in the string and checking if they belong to the set ... Read More
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
266 Views
Welcome to another in-depth guide on a fascinating problem-solving topic in C++. This time, we will be tackling the problem of determining if a string can be divided into two substrings, each containing an equal number of vowels. This problem is an excellent exercise for honing your skills in string manipulation and vowel counting. Problem Statement Given a string, our objective is to determine if it can be partitioned into two non-empty substrings such that both substrings have an equal number of vowels. The vowels in the English alphabet are 'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U'. ... Read More
![Siva Sai](https://www.tutorialspoint.com/assets/profiles/641140/profile/60_712060-1681791038.jpg)
77 Views
In certain applications, we might be interested in checking whether a sequence of path visits any coordinate twice or not. This can be useful, for example, in GPS tracking systems to detect if a vehicle is going back and forth between two points. In this article, we will discuss how to check if a sequence of path visits any coordinate twice or not, along with its implementation in C++. Algorithm To solve this problem, we can use a hash table to keep track of all the coordinates that we have visited so far. We start by visiting the first coordinate ... Read More
![Prabhdeep Singh](https://www.tutorialspoint.com/assets/profiles/546958/profile/60_1428686-1667456005.jpg)
85 Views
A binary string is a string that contains only zeros and ones as the different types of characters. We have given a binary string and the task is to divide it into some number of partitions (possibly zero) where each partition contains an equal ratio of zero and one. We will use the hashmap to solve the problem with efficient time and space complexity. Sample Examples Input 1: string str = 100010001 Output: 3 Explanation The given string can be partitioned into three substrings that will contain the same ratio of zeros and ones. We can break the string into ... Read More
![Prabhdeep Singh](https://www.tutorialspoint.com/assets/profiles/546958/profile/60_1428686-1667456005.jpg)
224 Views
We have given a singly linked list of characters, and our task is to print the character which occurs the maximum time in the linked list. If the multiple characters have the same count of occurring then print the character which comes in the last. The Singly-linked list is a linear data structure that consists of nodes. Each node contains the data and the pointer to the next node which contains the memory address of the next node because the memory assigned to each node is not continuous. Sample Examples Let us assume we have given a linked list of ... Read More