If I have 2 arrays, say array1 = {2, 2, 4, 5, 6} which has sorted array elements and array2 = {4, 2, 6, 2, 5} that has same elements as array1 but not in sorted condition. How can I compare that both arrays have same elements. I have written the following code which works in all conditions except when array1 has two same elements and array2 has all different elements.
I am extremely frustrated. Please help.
This is certainly great. I was wondering if there is any other way. Because I am very beginner in learning C++ and this permutation function is beyond my level of expertise in C++. Looks like you know a lot more than I do. Let me know if there is other way around.
I tried this but sounds like my compiler is not supporting the begin and end functions. I am using codeblocks 13.12 compiler to run only the C++ source file.
I am getting:
#error This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.
You need to enable C++11 for your CodeBlocks compiler - you should be able to do it in the project settings somewhere. I don't use CodeBlocks myself so you may want to use Google to search for how to enable C++11.
Thank you boss. I turned the feature on in my compiler and your suggestion worked like a charm without any error. This is cool. Learned something new. Thanks a lot. :)