Find odd occurring element in an array in single traversal

Given an array of integers, duplicates are present in it in such a way that all duplicates appear even number of times except one which appears odd number of times. Find that odd appearing element in linear time and without using any extra memory.

3 ways to use std::pair as a key to std::map in C++

In this post, we will see how to use std::pair as a key to std::map in C++. The std::pair in C++ binds together a pair of values of same or different types which can be then accessed through its first and second public members.