Search:
Forum
Beginners
smallest difference pairs
smallest difference pairs
Apr 14, 2018 at 10:40pm UTC
ghost1111
(81)
how would a write recursion program in C++ when trying to get Smallest Difference pair of values between two vectors?i know how to do it with array but how would we do it with std::vectors would we need to use std::sort still?any advice
Last edited on
Apr 14, 2018 at 10:52pm UTC
Apr 15, 2018 at 9:11pm UTC
Enoizat
(1343)
May this be helpful?
https://www.geeksforgeeks.org/smallest-difference-pair-values-two-unsorted-arrays/
Apr 15, 2018 at 9:20pm UTC
ghost1111
(81)
i cant use sort for this function im making i try so many thing to do with vectors it just doesnt work so i am lost
Apr 16, 2018 at 2:16am UTC
mbozzi
(3932)
Post your code that uses arrays.
Apr 16, 2018 at 8:31am UTC
keskiverto
(10402)
You say that "
std::sort just doesn't work with std::vector
".
However, the example in documentation does exactly that:
http://www.cplusplus.com/reference/algorithm/sort/
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs