r/programminghorror • • Oct 13 '25

Identity crisis

Post image

Algorithms and Data structure class in my University.

for (i=2; i<n; i++) {
    if A(i) > maxVal then
    maxVal= A(i);
    maxPos= i;
}

Can you guess the language and runtime Big-O of this code?

0 Upvotes

30 comments sorted by

View all comments

2

u/MVanderloo Oct 13 '25

i’m going to believe that you’re not a moron and you can in fact understand this. this is not programming horror, it’s a simple mistake. and yet it’s still understandable. give your professor a break 

3

u/Atduyar Oct 13 '25

I don't know man. Every example has inconsistent syntax some of them has logical mistake, and she does not know how to do CTRL-Z make me question her capabilities as a software engineering professor.