Python Loop For Each Element In Arraylist Vs Linked List