From 4f821e069e92b4a0366a4d05cd3a08465b9f009a Mon Sep 17 00:00:00 2001 From: mhdshameel Date: Sat, 27 Oct 2018 13:59:04 +0530 Subject: [PATCH] Create arrayintersection.cpp #13 array intersection in cpp --- .../arrayintersection.cpp | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Intersection of two Integer arrays/arrayintersection.cpp diff --git a/Intersection of two Integer arrays/arrayintersection.cpp b/Intersection of two Integer arrays/arrayintersection.cpp new file mode 100644 index 0000000..8e3781f --- /dev/null +++ b/Intersection of two Integer arrays/arrayintersection.cpp @@ -0,0 +1,24 @@ +#include + +//approach with O(n2) time complexity +std::vector ArrayIntersections(int * arr1, int arr1_size, int * arr2, int arr2_size) +{ + std::vector vIntersections; + for(int i = 0; i