Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
Implementation to find the non repeating integer in an array of repeating integers. Single Number More...
#include <cassert>
#include <iostream>
#include <vector>
Namespaces | |
namespace | bit_manipulation |
for IO operations | |
namespace | find_non_repeating_integer |
Functions to find the non repeating integer in an array of repeating integers. Single Number | |
Functions | |
int64_t | bit_manipulation::find_non_repeating_integer::find_non_repeating_integer (const std::vector< int > &nums) |
The main function implements find single number. | |
static void | test () |
Self-test implementations. | |
int | main () |
Main function. | |
Implementation to find the non repeating integer in an array of repeating integers. Single Number
Given an array of integers in which all of the numbers occur exactly twice except one integer which occurs only once. Find the non-repeating integer.
Worst Case Time Complexity: O(n) Space complexity: O(1)
int64_t bit_manipulation::find_non_repeating_integer::find_non_repeating_integer | ( | const std::vector< int > & | nums | ) |
The main function implements find single number.
nums | vector of integers |
int main | ( | void | ) |
|
static |
Self-test implementations.