Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
3 sum problem

Subject: 3 sum problem

From: Matthew

Date: 21 Feb, 2012 00:23:11

Message: 1 of 3

I need help writing a program to figure out the 3 sum algorithm. In this code I am given an array and then the code is supposed to take three numbers and they will equal zero. The equation is a+b+c=0

Subject: 3 sum problem

From: Roger Stafford

Date: 21 Feb, 2012 01:12:11

Message: 2 of 3

"Matthew " <mattsprague@cox.net> wrote in message <jhuo5f$k1r$1@newscl01ah.mathworks.com>...
> I need help writing a program to figure out the 3 sum algorithm. In this code I am given an array and then the code is supposed to take three numbers and they will equal zero. The equation is a+b+c=0
- - - - - - - - -
  This looks very much like class homework. You are unlikely to persuade people in this newsgroup to do the complete problem for you. However, if you can show some progress in coding it, you may get help improving it.

  To increase your chances of such cooperation you might also try improving your problem description. The phrase "take three numbers and they will equal zero" leaves much to be desired in clarity.

Roger Stafford

Subject: 3 sum problem

From: ImageAnalyst

Date: 21 Feb, 2012 02:03:28

Message: 3 of 3

On Feb 20, 7:23 pm, "Matthew " <mattspra...@cox.net> wrote:
> I need help writing a program to figure out the 3 sum algorithm. In this code I am given an array and then the code is supposed to take three numbers and they will equal zero.  The equation is a+b+c=0
-------------------------------------------------------------------------------------------------------------------
There may be no solution. If your array is [1, 2, 3, 4, 5, 6] you
won't be able to find any three that sum to zero.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us