TheAlgorithms/C++ 1.0.0
All the 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>
Go to the source code of this file.
Namespaces | |
namespace | bit_manipulation |
for assert | |
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)
Definition in file find_non_repeating_number.cpp.
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 |
Definition at line 39 of file find_non_repeating_number.cpp.
int main | ( | void | ) |
Main function.
Definition at line 85 of file find_non_repeating_number.cpp.
|
static |
Self-test implementations.
Definition at line 62 of file find_non_repeating_number.cpp.