HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Determining a value in an algorithm on its first run

Submitted by: @import:stackexchange-cs··
0
Viewed 0 times
determiningvaluealgorithmitsfirstrun

Problem

I was given the following algorithm as a solution to one of my problems.
However, I am baffled at understanding how c' is ever initialized. The first if statement can never be reached, as c' is never set the first time. Can someone explain this to me? Am I just missing where c' gets set?

This is for Kleinberg and Tardos, Chapter 11, Question 12.

Solution

Posting Yuval Filmus's comment as an answer since they didn't:


It’s a typo - should be $c’=$ instead of $c’-$ in line 5.

Context

StackExchange Computer Science Q#101369, answer score: 2

Revisions (0)

No revisions yet.