Hi. I was wondering how I could replace objects in a list without using a single loop. Here's what I have in terms of algorithm; but, I don't know how to implement.:
replace(List list, oldObject, newObject)
1. if the first element in list is not null
2 if the old Object == (the object in list)
3 new object replaces old Object
4 replace(list, oldObject, newObject)
Ps. I know the == is not allowed when comparing objects, its just pseduo code
I don't know how to traverse through the list without a for loop. Could I use iterator?