Skip to content

Book Corrections - Complexity Notation & Euclidean Algorithm #352

Open
@Uabanur

Description

@Uabanur

While reading through the leading chapters of the book on https://www.algorithm-archive.org/ (august 10'th, 2018) I found some sections/descriptions which felt incomplete, and thought I might give my feedback.

Complexity Notation:

  • It is unclear what is seen as an operation. It assumed that the operation initially is seen as the array-lookup, and not the print statement.

  • In example two the operations are conditional to the length of the array which is unnecessary for the point of the example.

  • In the second example of 'Linear Time', the explicit runtime is said to be Theta(3n/2+2) but again it is ambiguous as to what counts as an operation. If it is focused on array-lookup as well as the addition operation, the time would instead be Theta(5n/2+2), assuming we ignore the println statement of the independent string. To further state this argument, the multiplication and addition of the array index would also be calculated separately before the array-lookup, as well as printing the independent string, making the explicit runtime Theta(10n/2+3).

  • The chapter nicely grasps the concept of complexity notation, but does not describe how O and Omega are the upper and lower bound of Theta very well. This could be clear with an example also.

  • The exponential example has no terminating condition, causing stackoverflow independent of parameters.

  • The logarithmic example is not logarithmic, as both branches are explored.

Euclidean Algorithm:

  • the euclid_mod and euclid_sub examples are swapped in the text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    DiscussionThis is open for a discussion.ProblemThis is a problem in the archive or an implementation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions