Number of Longest Increasing Subsequence


  • 0

    Click here to see the full article post


  • 0
    M

    "Implementing Segment Trees is discussed in more detail here" - the link appears broken.


  • 0
    C

    Maybe a problem in python version of Approach #2: Segment Tree

    1. range_mid will get a float, so in function insert, the equation will hardly true, I think the range_mid should return an interger
    2. I think this algorithm will be inefficient in some situation: [1, 5, 50, 32, 99999999], that is, when the range of min value to max value is too large with only few numbers. Because the insert will continue go deeper until come to a leaf (a value).

    Welcome to discuss


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.