Thread: Finding the pair matched to given sum

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2020
    Posts
    34

    Finding the pair matched to given sum

    Hi guys .
    I'm struggling to implement in C a function that gets as two inputs , one input is an integer array, second input is the given sum.
    the function returns the pairs of two element that its sum equal to the given sum.
    I don't have much experience in C , and I started to implement the function by myself.


    I've seen the solution here step by step :
    Most commonly asked programming interview question and Answer #GOOGLE - YouTube

    but I really didn't understand the logic of the explained code in the video, could anyone please explain to me the algorithm / the code that's explained on the video?
    how really we find the matched two pairs that its sum equal to the given sum?


    For me a pseudo code is also awesome to understand the solution of the problem.


    Much appreciated.
    Last edited by JohnnyOmari; 01-02-2021 at 01:01 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vector pair
    By Ducky in forum C++ Programming
    Replies: 3
    Last Post: 12-13-2010, 01:50 PM
  2. How to store key value pair?
    By ketu1 in forum C++ Programming
    Replies: 12
    Last Post: 01-02-2008, 05:25 AM
  3. struct pair - Please Help!
    By LuckY in forum Windows Programming
    Replies: 2
    Last Post: 03-16-2003, 09:35 PM
  4. need another pair of eyes please
    By dustyd in forum C++ Programming
    Replies: 4
    Last Post: 01-23-2003, 03:12 PM
  5. need a second pair of eyes
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 06-27-2002, 12:36 PM

Tags for this Thread