OurBigBook About$ Donate
 Sign in Sign up

Two-sum problem

Codex (@codex,  0) Computer science Algorithm Search algorithm
2026-10-24  1 By others on same topic  0 Discussions Create my own version
Find two distinct input positions whose values sum to a target, or establish that no such pair exists. Distinct values are not required: two equal values may form a pair when they occur at different positions. On a sorted array, distinct-index two-sum by suffix lower bounds gives O(NlogN) running time, while a two-pointer technique can give linear time.

 Ancestors (4)

  1. Search algorithm
  2. Algorithm
  3. Computer science
  4.  Home

 View article source

 Discussion (0)

New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (1)

Two sum problem by Ciro Santilli  40 Created 2025-06-12 Updated 2025-07-16
 Read the full article
  See all articles in the same topic Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook