
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
Found 1860 Articles for Data Structure

91 Views
Modifying string by sorting characters after the removal of characters whose frequency is not equal to the power of 2 is a popular problem in the field of computer programming, particularly in the context of competitive programming. The problem involves taking a string as input and modifying it by removing characters whose frequency is not a power of 2, and then sorting the remaining characters in lexicographically increasing order. In this tutorial, we will provide a detailed solution to this problem using the C++ programming language. We will start by discussing the problem statement in greater detail, exploring the ... Read More

176 Views
Modifying a string by replacing characters with alphabets whose distance from that character is equal to its frequency is an intriguing problem that involves manipulating strings in a unique way. The task is to take a given string as input and replace each character in the string with an alphabet that is at a distance equal to the frequency of that character in the string. For instance, if the character 'a' appears three times in the string, it would be replaced by an alphabet that is three positions away from 'a' in the English alphabet. This problem presents an interesting ... Read More

227 Views
Longest Common Subsequence (LCS) is a classic problem in computer science that involves finding the longest subsequence that is present in two given strings. In this tutorial, we will explore a unique approach to solving this problem, which involves repeatedly swapping characters between the two strings until we find the LCS. This approach involves a bit of creativity and is not commonly used, but it can be useful in certain situations. We will be using the C++ programming language to implement this solution, and we will provide a step-by-step guide on how to do so. So, let's dive in ... Read More

132 Views
Checking if any pair of consecutive 1s can be separated by at most M 0s by circular rotation of a Binary String is a common problem in computer programming and binary manipulation. The task is to determine whether a given binary string can be rotated in a circular manner such that any pair of consecutive 1s in the string can be separated by at most M 0s. This problem arises in various applications, such as image processing, data compression, and information retrieval. In this tutorial, we will delve into the intricacies of this problem statement and provide a solution ... Read More

163 Views
Checking if a Binary String contains A pairs of 0s and B independent 0s or not is a common problem encountered in computer science, particularly in the field of algorithms and data structures. The problem statement is quite simple and plays a significant role in various fields, such as cryptography, network security, and machine learning. In this tutorial, we will discuss a solution to this problem using C++. We will first provide an overview of the approach starting with defining the problem statement with some examples and, then we will dive into the implementation details. So let’s get started! ... Read More

176 Views
An equilateral triangle is a triangle with all of its sides equal in length. As the three sides are equal, the three angles opposing the equal sides are also equal in magnitude. As a result, it is also known as an equiangular triangle, with each angle measuring 60 degrees. The centroid of an equilateral triangle is the point where its three medians intersect. In an equilateral triangle, all three sides are of equal length and all three angles are of equal measure, so each median will intersect at the same point, which is the centroid. Problem Statement Given length ... Read More

422 Views
A sphere is a three-dimensional geometric shape that is perfectly round like a ball, while a hemisphere is one half of a sphere. In essence, a sphere would split into two hemispheres if it were sliced in half. Hemispheres are identified by their curving surface, which radiates out from the sphere's core. The Greek terms "hemi" (half) and "sphaira" (sphere) are where the name "hemisphere" comes from. Hemispheres are used to describe and simulate a variety of events in a number of disciplines, including geography, astronomy, mathematics, and physics. Volume of a Hemisphere The volume of a hemisphere is equal ... Read More

528 Views
A factorial of a number is the product of all positive integers up to the given number. For example, the factorial of 5 is denoted as 5! and is equal to the product of all positive integers up to 5: 5! = 5 x 4 x 3 x 2 x 1 = 120 The number of zeros at the end of the decimal representation of a number's factorial is referred to as the "trailing zeros" in a factorial. The factorial of 5, for instance, is 120, which has one trailing zero, while the factorial of 10, on the other hand, ... Read More

337 Views
The Leibniz harmonic triangle, also known as Leibniz's series or the Leibniz formula, is a triangular arrangement of numbers discovered by German mathematician and philosopher Gottfried Wilhelm Leibniz in the late 17th century. The Leibniz harmonic triangle is a triangular arrangement of fractions. We start at the top with the number and the outermost terms are reciprocal of the natural numbers depicting that particular row number. In general, a term in the leibniz harmonic triangle can be determined by the following equation, where r is the row number and c is the column number with the condition that c

198 Views
The decimal expansion of a fraction is the decimal representation of the fraction's value. In the following article we discuss two approaches to find the first occurrence of c in a/b. Problem Statement Given three integers a, b, c, locate the first instance of c in the fraction a/b after the decimal point. Print-1 if it does not exist. Sample Examples Input a = 5, b = 6, c = 3 Output 2 Explanation $$\mathrm{\frac{a}{b}=\frac{5}{6}=0.83333}$$ So c=3 occurs at the 2nd place after the decimal point. Hence the output is 2. Input a = -10, b = ... Read More