## A better way to sort c++ stl vector

In this blog we are going to discuss a better way to sort c++ stl vector in descending order. for example if the given vector is vector<int> vec =...

## Binary tree inorder traversal without recursion using stack

In this blog we are going to discuss how to implement binary tree inorder traversal without recursion using stack. How to approach solution for Binary tree inorder traversal without...

## how to use 2d vector in c++

In this blog we would learn how to use 2d vector in c++. 2d vectors are vectors of vectors. 2d vectors can be considered as 2d matrix. We can...

## how to iterate map in c++

In this tutorial we are going to learn how to iterate map in c++. Let us see a very basic example uses of c++ map. #include <iostream> #include <map>...

## Print all nodes of the same level from binary tree

Print all nodes of the same level from binary tree. For example the output for the below binary tree is 6,8,5,8,3. C++ Print all nodes of the same level...

## C program for longest substring without repeating characters

Write a C program for longest substring without repeating characters. For example if the string is “abcdabc” the longest substring without repeating is “abcd” of length 4. C program...

## merge two sorted linked lists in sorted order

Write a c program to merge two sorted linked lists in sorted order. For example if one linked list is 1->2->3->null and other is 1->3->5->6->null then the output should...

## find kth smallest element in binary search tree

You are given a binary search tree. Write c or c++ program to find kth smallest element in it. For in given bst the 3 is first smallest and...

## C program to count size of binary tree

Given a binary tree write a C program to count size of binary tree. For example the size of binary tree is 4 in below binary tree. (3) /...

## c program to print reverse of a linked list using recursion

c program to print reverse of a linked list using recursion. for example if the given linked list is 0->1->2->NULL then the recursive function should print 2 1 0....