Concept

Algorithms

Always state time and space complexity in interviews.

Where it fits

  1. Algorithms
  2. Algorithms

Packages: Algorithms (pkg4algorithms)

Learn

Existing chapters for this concept.

See it in code

Existing Java examples.

Practice

Existing LeetCode material in JavaForge.

  • Maximum Subarray

    Blind 75 · Array · pkg5leetcode/blind75/blind75_LC53MaximumSubarray.java · pkg5leetcode · blind75_LC53MaximumSubarray.java

    Kadane's algorithm tracks best ending-here sum. Time O(n), Space O(1)

    Open practice
  • Maximum Subarray

    Starter · Kadane · pkg5leetcode/leetcode5MaxSubArray.java · pkg5leetcode · leetcode5MaxSubArray.java

    Find the contiguous subarray with the largest sum. Kadane's algorithm. Track best sum ending here; reset when it goes negative. Time O(n), Space O(1).

    Open practice

Prepare

Existing interview questions.

Java versions