Write a method boolean Replace(int item, int new_item) that replaces all occurrences of item in a list with new_item and
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Write a method boolean Replace(int item, int new_item) that replaces all occurrences of item in a list with new_item and
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.