Posts from C++

Find K’th largest element in a stream in C++

By Amit Raja Kalidindi

In this tutorial, we are going to learn how to find the K-th largest element in a stream of numbers using C++. Naive Solution for finding K-th largest element in a stream We can cr.... Read More

Lexicographically next permutation in C++

By Mohit Goswami

In this tutorial, we going to find the next permutation of a string in lexicographically (dictionary order) in C++. The basic need for this is when doing mathematical problems requ.... Read More

std::stoul and std::stoull functions in C++

By Siddhant Chouhan

In this post we will learn about std::stoul and std::stoull functions in C++. You can use std::stoul function to convert a string to an unsigned long value. Also, you can use std::.... Read More

Iterator Invalidation in C++

By Prabhnoor Singh

There are many cases in which our iterator gets invalidated while we iterate any container. This can be due to many reasons including the change in size or shape of the container w.... Read More

Deleting a Linked List in C++

By Pranav Prakasan

This article discusses a method and a program for deleting a linked list in C++. A linked list may be entirely removed by deleting all its nodes. We may do this by traversing throu.... Read More

Handling Divide by Zero Exception in C++

By Priya Bansal

Today we’ll learn how to handle divide by zero exception in C++. Exception handling is an important feature in programming and software development. It tells the compiler how.... Read More

Check if a given array contains duplicate elements within k distance from each other in C++

By Vishal Patil

Hello everyone, in this tutorial, we will check if a given array contains duplicate elements within k distance from each other in C++. Examples Input 1 : a[] = {1,4,2,1,5} k=2 Outp.... Read More

Count minimum frequency elements in a Linked List in C++

By Sonal Bera

Hello every one, here in this article, we have to count the minimum frequency of elements in a Linked List in C++. In simple terms, we have to determine those elements in the list,.... Read More