In the following image
![click me for an image because I need 10 rep first](https://i.stack.imgur.com/j57Eh.png)

The author refers to an overall running time linear to |E|. But the author then says this is at most O(n^2). This seems contradictory because O(n^2) is quadratic time. Did the author mean to write something else? Or am I misunderstanding something? 

**EDIT!: My question is: What does the author mean when writing "overall running time linear to |E|"?**

EDIT: More context, define E, which is all the edges and is stored as variable j: [![enter image description here](https://i.stack.imgur.com/OH56y.png)](https://i.stack.imgur.com/OH56y.png)