Page 1 of 1

Write a method boolean Replace(int item, int new_item) that replaces all occurrences of item in a list with new_item and

Posted: Tue Jul 12, 2022 8:16 am
by answerhappygod
Write a method boolean Replace(int item, int new_item) thatreplaces alloccurrences of item in a list with new_item and return false ifnew_item is not found. Forexample, if item is “3” new_item is 5, then the method shouldreplace all nodes thatcontain 3 with 5.