equal elements in two arrays in c++
C++
bool equalelementsintwoarrays(int A[], int B[], int N) {
sort(A, A+N);
sort(B, B+N);
int i = 0, j = 0;
while (i < N && j < N) {
if (A[i] == B[j]) return true;
else if (A[i] > B[j]) j++;
else i++;
}
return false;
}
Also in C++:
- Title
- digitalwrite C++
- Category
- C++
- Title
- c++ compare char
- Category
- C++
- Title
- error: ISO C++ forbids comparison between pointer and integer [-fpermissive] if(s[i] != "b"){
- Category
- C++
- Title
- ios_base::sync_with_stdio(false);cin.tie(NULL);
- Category
- C++
- Title
- static variable in c++
- Category
- C++
- Title
- leveling system c++
- Category
- C++
- Title
- c++ code to print hello world
- Category
- C++
- Title
- power in c++
- Category
- C++
- Title
- object reference not set to an instance of an object c#
- Category
- C++
- Title
- c++ cout int
- Category
- C++
- Title
- get elements of 2d array c++
- Category
- C++
- Title
- c++ string^ to char*
- Category
- C++
- Title
- calling by reference and pointers c++
- Category
- C++
- Title
- pop from between string c++
- Category
- C++
- Title
- How to read a file in in C++
- Category
- C++
- Title
- opencv compile c++
- Category
- C++
- Title
- c++ write string
- Category
- C++
- Title
- removing repeated characters in a string c++
- Category
- C++
- Title
- mkdir boost filesystem
- Category
- C++
- Title
- create new file c++
- Category
- C++
- Title
- first prime numbers
- Category
- C++
- Title
- root to leaf path print
- Category
- C++
- Title
- convert string to stream c++
- Category
- C++
- Title
- Convert binary tree to a doubly linked list
- Category
- C++
- Title
- what is time complexity of insertion sort
- Category
- C++
- Title
- c++ unittest in ros
- Category
- C++
- Title
- solve linear equations geeksforgeeks
- Category
- C++
- Title
- check if intent has extras
- Category
- C++
- Title
- program to know if a number is prime
- Category
- C++
- Title
- select elements from array C++
- Category
- C++
- Title
- how to ensure the user inouts a int and not anything else c++
- Category
- C++
- Title
- c++ create object
- Category
- C++
- Title
- c++ multiple inheritance diamond problem
- Category
- C++
- Title
- binary tree search
- Category
- C++
- Title
- c++ movment
- Category
- C++
- Title
- how print fload wiht 3 decimal in c++
- Category
- C++
- Title
- mysqli connect
- Category
- C++
- Title
- how to delete something in an array c++
- Category
- C++
- Title
- delete files c++
- Category
- C++
- Title
- c++ class template
- Category
- C++
- Title
- how to delete an element in vector pair in cpp
- Category
- C++
- Title
- namespace c++
- Category
- C++
- Title
- bitset c++
- Category
- C++
- Title
- Read multiple files(.txt) c++
- Category
- C++
- Title
- create a dictionary cpp
- Category
- C++
- Title
- c++ function return array
- Category
- C++
- Title
- prefix sum array
- Category
- C++
- Title
- sieve of eratosthenes c++
- Category
- C++
- Title
- qt graphics scene map cursor position
- Category
- C++
- Title
- shortest path with bfs in c++
- Category
- C++
- Title
- c++ typeid get type name
- Category
- C++
- Title
- is x prime?
- Category
- C++
- Title
- cout console
- Category
- C++
- Title
- subarray sum in c++
- Category
- C++
- Title
- C++ Student::Student()
- Category
- C++
- Title
- translate
- Category
- C++
- Title
- ue4 c++ enum
- Category
- C++
- Title
- primeros numeors primos menores que
- Category
- C++
- Title
- fast input output in c++
- Category
- C++
- Title
- C++ string format ctime
- Category
- C++
- Title
- inserting an element in an set c++
- Category
- C++
- Title
- console colors in C++
- Category
- C++
- Title
- c++ program for addition of two numbers using functions
- Category
- C++
- Title
- first fit algorithm
- Category
- C++
- Title
- calling a method on an object c++
- Category
- C++
- Title
- c++ ros subscriber
- Category
- C++
- Title
- 2927260.eps 2927262.jpg 2927263.ai License free.txt License premium.txt
- Category
- C++
- Title
- how to find the mode of a vector c++
- Category
- C++
- Title
- arduino falling edge
- Category
- C++
- Title
- for loop
- Category
- C++
- Title
- c++ while true
- Category
- C++
- Title
- insert function in c++ vector
- Category
- C++
- Title
- mark occurances of elements in array cpp
- Category
- C++
- Title
- gta san andreas
- Category
- C++
- Title
- counting valleys hackerrank solution in c++
- Category
- C++
- Title
- c++ excel blank cells
- Category
- C++
- Title
- c++ cli convert string to string^
- Category
- C++
- Title
- dijkstra in c++
- Category
- C++
- Title
- traverse map c++
- Category
- C++
- Title
- deque c++
- Category
- C++
- Title
- how to type cast quotient of two integers to double with c++
- Category
- C++
- Title
- registering a new QML type
- Category
- C++
- Title
- new class * [] c++
- Category
- C++
- Title
- Operator overloading in C++ Programming
- Category
- C++
- Title
- binary search stl in c++
- Category
- C++
- Title
- cut by delimiter c++
- Category
- C++
- Title
- floor() in c++
- Category
- C++
- Title
- new keyword in cpp
- Category
- C++
- Title
- vector concat c++
- Category
- C++
- Title
- get data from terminal c++
- Category
- C++
- Title
- new c++
- Category
- C++
- Title
- cube mapping sdl
- Category
- C++
- Title
- quick sort predefined function in c++
- Category
- C++
- Title
- iterative preorder traversal
- Category
- C++
- Title
- c++ isalphanum
- Category
- C++
- Title
- prims c++
- Category
- C++
- Title
- std::iomanip c++
- Category
- C++
- Title
- modular exponentiation c++
- Category
- C++
- Title
- c++ method name
- Category
- C++
- Title
- stl sort in c++
- Category
- C++