Courses
Tutorials
Jobs
Practice
Contests
Data Structure
Java
Python
HTML
Interview Preparation
Trending Now
DSA
Web Tech
Foundational Courses
Data Science
Practice Problem
Python
Machine Learning
JavaScript
System Design
Django
DevOps Tutorial
Java
C
C++
ReactJS
NodeJS
CP Live
Aptitude
Puzzles
Projects
Comparison between Height Balanced Tree and Weight Balanced Tree
What is Height Balanced Tree?Self-Balancing binary search trees are the height-balanced binary tree is one for which at every node, the absolute value of the difference in...
Read More
Misc
Tree
Difference Between
DSA
Replace every array element with maximum of K next and K previous elements
Given an array arr, the task is to replace each array element by the maximum of K next and K previous elements.Example:Input: arr[] = {12, 5, 3, 9, 21, 36, 17}, K=2Output:...
Read More
Arrays
Tree
Mathematical
Segment-Tree
array-rearrange
DSA
Flip the given Matrix along both diagonals in clockwise direction
Given a matrix arr[][] of size M*N, where M is the number of rows and N is the number of columns. The task is to flip the matrix by both diagonals. Flipping the matrix mea...
Read More
Matrix
DSA
Rearrange given Array by replacing every element with the element located at mean of adjacent elements
Given an array arr[]. The array contains numbers from 0 to N-1 only, where N is the size of arr[]. The task is to modify the array in such that for each i from 0≤iN, arr[i...
Read More
Arrays
Mathematical
array-rearrange
maths-mean
DSA
Find the Nth term of the series 3, 7, 19, 55, 163, . . .
Given a positive integer N. The task is to find Nth term of the series 3, 7, 19, 55, 163, .....Examples:Input: N = 5Output: 163Input: N = 1Output: 3Approach: The sequence ...
Read More
Pattern Searching
Mathematical
Sequence and Series
DSA
Multimap of tuples in C++ with Examples
What is a multimap?In C++, a multimap is an associative container that is used to store elements in a mapped fashion. Internally, a multimap is implemented as a red-black ...
Read More
STL
C++
cpp-multimap
cpp-tuple
Multimap of pairs in C++ with Examples
What is a multimap?In C++, a multimap is an associative container that is used to store elements in a mapped fashion. Internally, a multimap is implemented as a red-black ...
Read More
STL
C++
cpp-pair
cpp-multimap
Array of list in C++ with Examples
What is an array?An array in any programming language is a data structure that is used to store elements or data items of similar data types at contiguous memory locations...
Read More
Arrays
STL
cpp-array
C++
Arrays
cpp-list
DSA
Array of unordered maps in C++ with Examples
What is an array?An array in any programming language is a data structure that is used to store elements or data items of similar data types at contiguous memory locations...
Read More
Arrays
STL
cpp-array
C++
Arrays
cpp-unordered_map
DSA
Array of maps in C++ with Examples
What is an array?An array in any programming language is a data structure that is used to store elements or data items of similar data types at contiguous memory locations...
Read More
STL
cpp-array
C++
cpp-map
Find Median of two given Vectors
Given two vectors, a and b of different sizes, where array a has m number of elements and array b has n number of elements. The task is to find the median of two vectors. ...
Read More
Mathematical
cpp-vector
C++ Programs
DSA
Pointers vs Array in C++
Arrays and pointers are two derived data types in C++ that have a lot in common. In some cases, we can even use pointers in place of arrays. But even though they are so cl...
Read More
cpp-array
cpp-pointer
C Language
C++
C-Pointers
C-Arrays
Difference Between
Algo-Geek 2021
Swapping two numbers using template function in C++
A significant benefit of object-oriented programming is the reusability of code which eliminates redundant coding. An important feature of C++ is called templates. Templat...
Read More
CPP-Functions
C++ Programs
Swap-Program
Sorting 2D Vector of Pairs in C++
A 2D vector also known as vector of vectors is a vector in which each element is a vector on its own. In other words, It is a matrix implemented with the help of vectors.W...
Read More
Sorting
STL
cpp-vector
C++
cpp-pair
DSA
Find the sum of alphabetical order of characters in a string
Given string S of size N, the task is to find the sum of the alphabet value of each character in the given string.Examples:Input: S = “geek”Output: 28Explanation:The value...
Read More
Strings
Mathematical
cpp-string
ASCII
DSA
1
...
5207
5208
5209
...
11601