Check Palindrome in Java

Aishwarya Naglot
Updated on 13-May-2025 14:24:53

5K+ Views

What is a Palindrome? A palindrome is a number, string or any data value, which reads the same from backwards. i.e. If we reverse a value and compare it with its original value, the result should be true. For example, strings like "ABA", "RADAR", "BABAB" and numbers like 121, 12321 are palindromes. Checking for Palindrome Using Java Program One way to verify if a string, number or, an alphanumeric value is a palindrome is by reversing the given it. Following are the steps - Get the value to be verified. Reverse the contents of the given value. Compare ... Read More

Implement Priority Queue in C++ using STL

Farhan Muhamed
Updated on 12-May-2025 19:46:02

347 Views

Priority Queue is a special type of queue in which elements can be accessed based on their priority. In this article, we will learn how to use the priority_queue container from the Standard Template Library (STL) in C++. What is Priority Queue? A Priority Queue is a container that stores data in such a way that the highest (or the lowest) priority element will always at the front of queue. Meaning, a priority queue does not follow FIFO rule of a regular queue, it processes elements based on ceratin priority. This priority can be defined as highest elements at ... Read More

C++ Program to Implement Set in STL

Farhan Muhamed
Updated on 12-May-2025 19:45:46

709 Views

Set is an associative container that stores unique elements in a sorted order. In this article, we will learn how to use the set container from the Standard Template Library (STL) in C++. What is Set? A Set is a container that stores data in a sorted order without any duplicates. Meaning, the duplicate values are automatically eliminated, and the elements are kept in ascending order by default. The STL library of C++ provides a pre-defined set container that uses a balanced binary search tree for storage. For example, in the code we have shown how data are ... Read More

Implement Set Difference in C++ STL

Farhan Muhamed
Updated on 12-May-2025 19:45:32

1K+ Views

The Set Difference is an operation used to find all elements present in the first set but not in the second. In this article, we will learn how to use the set_difference algorithm from the Standard Template Library (STL) in C++ to find the difference of two sets. What is Set Difference? The set difference is an arithmetic operation performed between two sets to find all elements present in the first set but not in the second. In C++, we have set_difference which is a built-in algorithm provided by C++ STL that computes the set difference of two sorted ... Read More

Implement Set Intersection in C++ using STL

Farhan Muhamed
Updated on 12-May-2025 19:45:20

817 Views

The Set Intersection is an operation used to find all elements that are common in both sets. In this article, we will learn how to use the set_intersection algorithm from the Standard Template Library (STL) in C++ to find the intersection of two sets. What is Set Intersection? The set intersection is an arithmetic operation performed between two sets to find all elements that are common in both sets. In C++, we have set_intersection which is a built-in algorithm provided by C++ STL that computes the intersection of two sorted ranges of sets. That is, it returns the elements ... Read More

Implement Set Symmetric Difference in C++ STL

Farhan Muhamed
Updated on 12-May-2025 19:45:08

470 Views

The Set Symmetric Difference is an operation used to find all elements that are present in either of the sets but not in both. In this article, we will learn how to use the set_symmetric_difference algorithm from the Standard Template Library (STL) in C++ to find the symmetric difference of two sets. What is Set Symmetric Difference? The set symmetric difference is an arithmetic operation performed between two sets to find all elements that are present in either of the sets but not in both. In C++, we have set_symmetric_difference(), which is a built-in function provided by C++ STL ... Read More

The Mutable Storage Class in C++

Akansha Kumari
Updated on 12-May-2025 19:38:58

2K+ Views

The mutable storage class in C++ is a property that gives you access to modify the non-static data members (not static data members) of a class, even when the object is declared as constant. This is mainly useful for scenarios where the data needs modification without affecting the logical state of the object, like caching, lazy initialization, and logging. Syntax class class_name { mutable data_type member_name; }; Here is the following syntax for the mutable storage class, which is declared using the mutable keyword and applied to only non-static data members of a class. Example #include ... Read More

C++ Standard Library Header Files

Akansha Kumari
Updated on 12-May-2025 19:38:45

2K+ Views

Standard Library header files are the predefined files in C++, which are part of the built-in library. It consists of declarations for functions, classes, objects, and macros. These header files give you access to perform various operations like input/output, string manipulation, containers, algorithms, math operations, and many more. Here is the following list of all the types of libraries under the standard Library Header Files. Utilities library Dynamic memory management Numeric limits Error handling String library ... Read More

Compile and Run C++ Program

Akansha Kumari
Updated on 12-May-2025 19:38:32

173K+ Views

The C++ programming language is a set of instructions that tells the compiler how to perform specific tasks. These instructions consist of functions and statements, which, when compiled and executed, tell the computer what action to perform.  Prerequisite To compile and execute the program following prerequisites need to be met. Compiler: Any compiler downloaded and installed, like GCC, Clang, or MSVC, or an IDE (like Visual Studio Code, Code::Blocks, or Eclipse). Source program: And a source program file saved as name.cpp (example: Myfile.cpp) Instructions Here are the following instructions to ... Read More

Rules for Operator Overloading in C++

Akansha Kumari
Updated on 12-May-2025 19:38:14

16K+ Views

Operator overloading in C++ is the feature that allows you to define how operators will behave for user-defined data types like classes and structures. Operator overloading and function overloading both support compile-time polymorphism. In the following article, we will learn the rules that need to be followed for operator overloading. Rules for Operator Overloading Only built-in operators can be overloaded. If some operators are not present in C++, we cannot overload them. The arity of the operators cannot be changed. The precedence and associativity of the operators ... Read More

Advertisements