Found 7333 Articles for C++

Program to find Mode if Mean and Median are given of an array in C++

AYUSH MISHRA
Updated on 10-Nov-2024 13:49:04

4K+ Views

Mean, median and mode are three basic concepts of statistics. These quantities help in understanding the central tendency and distribution of given data. In this article we are going to learn, how we can find the Mode if the Mean and Median of a given array (which is the same as ungrouped data) in C++.  Problem statement We are given an array of numbers and we have to find the mode if mean and median are given in C++.  Example Input [5, 15, 25, 35, 35, 40, 10] Mean = 20Median = 25 Output 35 Brute Force Approach Mode is ... Read More

Clear bit ranges in given number in C++

Jiya Garg
Updated on 02-Sep-2024 17:33:55

233 Views

Given a number n, write C++ program to clear bits in the given range between l and r. Where, 1

Difference Between Vector and List

Shirjeel Yunus
Updated on 22-Jul-2024 11:34:04

911 Views

Vector and List are present in many programming languages like C++, R, etc. and they are used to add and remove elements. These elements can be accessed randomly in a vector but not in a list. In this article, we will discuss the difference between vector and list in C++. What is Vector in C++? A vector is a container which works as a dynamic array. It can be used to store elements whose datatype is same. Vectors also have a characteristic of growing or shrinking at runtime. Vectors belong to the Standard Template Library (STL) and header file ... Read More

Overview of the C++ Language Binding in the ODMG Standard

sudhir sharma
Updated on 22-Jan-2024 16:15:03

549 Views

Introduction Diving into the world of data management and modeling can be a complex task, especially when dealing with standards like the Object Data Management Group (ODMG). Did you know that ODMG provides an essential standard for object-oriented database systems, including a C++ language binding? This article will guide you through an easy-to-understand overview of this very aspect of ODMG, highlighting its key features such as ODL constructs and transactions. Overview of the ODMG Standard The ODMG standard, developed by the Object Data Management Group (ODMG), provides a framework for managing object-oriented databases. It includes the Object Definition Language (ODL) ... Read More

Number of palindromic subsequences of length k where k <= 3

Riya Kumari
Updated on 05-Jan-2024 16:11:39

329 Views

Palindromes are series of letters, numbers or characters which have same starting and ending point. Also, they are same when read from left to right and right to left. A subsequence of a string is a new string which is made by removing some of the characters from the original string without changing the relative order of the characters which are remaining. Suppose you are given a string of length N. You want to find palindromic subsequences of length K from the string. Note that value of K can be less than or equal to 3. In this article, we ... Read More

Number of palindromic paths in a matrix

Riya Kumari
Updated on 05-Jan-2024 16:10:04

282 Views

Palindromic pathways are very useful in solving various problems involving patterns and sequences. It can be used in finding correct path in a maze without reversing, palindromes in a sequence of letters, etc., It can also be used to identify symmetric patterns and structures. In this article, we will discuss about palindromic paths and ways to find such paths in a matrix using C++. Palindromes are series of letters, numbers or characters which have same starting and ending point. Also, they are same when read from left to right and right to left. A path in a matrix is a ... Read More

Number of palindromic permutations

Riya Kumari
Updated on 05-Jan-2024 16:08:18

341 Views

Permutations are possible in strings as well as numbers. A string can have permutations equal to the factorial of its number of characters. These permutations can be palindromic under certain circumstances. In this article, we will discuss about how palindromic permutations occur in a string. We will also find the number of palindromic permutations possible in a string using C++. Permutation is a mathematical process of rearranging the letters or characters from a specified string or words. In other words, it is rearrangement of objects or elements in an order. A palindrome is a set of character which are same ... Read More

Number of ordered pairs such that Ai & Aj = 0

Riya Kumari
Updated on 05-Jan-2024 16:04:48

296 Views

Suppose you are given an array and you have to find the total count of ordered pairs formed such that Ai & Aj = 0. You are given an array A[A1, A2, A3, …An]. You have to find ordered pairs of Ai and Aj such that their bitwise AND operation will give the result equal to 0. In other words, you have to count the pairs of elements (i, j) whose bitwise AND operation is zero. For example, we have an array [3, 4, 2]. The binary representation of each element are as follows − A1 = 3 = ... Read More

Number of n digit stepping numbers - space optimized solution

Riya Kumari
Updated on 05-Jan-2024 16:02:29

162 Views

In this article, we will learn about stepping numbers. We will find the possible number of n digit numbers which are also stepping numbers using several C++ techniques. We will also discuss about the most space optimized solution. Let’s first discuss about stepping numbers. These are such numbers which have adjacent digits in such a way that they all have a difference of 1. For example, 321- each of the adjacent digits (3, 2, 1) have a difference of 1 consecutively. Here, we will be given the value of N and then we have to find the count of all ... Read More

Number of n digit numbers that do not contain 9

Riya Kumari
Updated on 05-Jan-2024 16:01:04

195 Views

Suppose you have a given number N. Now, you want to find those numbers of N digit which do not contain 9. This question can be solved by permutation and combination mathematically. In this article, we will find such numbers and count them using C++. Suppose you have to find 1-digit numbers which do not contain 9. So, these numbers are (0 – 8). There are in total 8 such numbers. Similarly, we have to find the count of N digit such numbers. Here, we will be given the value of N and then we have to find the count ... Read More

Previous 1 ... 4 5 6 7 8 ... 734 Next
Advertisements