Could anybody solve this error? Thanks!
on line 7, why length+1? it is perfect, look:
1 / 2 = 0
3 / 2 = 1
5 / 2 = 2
7 / 2 = 3
in case this calculation isn't clear, the first number is the length of the list, divided by 2 (obviously) which gives the index. if you think about it, the indexes perfectly match with the middle item.
You're right, I worked it out