4. Remove all occurrences of a particular element from an array Consider an array named source. Write a method/function named removeAll( source, size, element) that removes all the occurrences of the...


4. Remove all occurrences of a<br>particular element from an array<br>Consider an array named source. Write a<br>method/function named removeAll( source,<br>size, element) that removes all the<br>occurrences of the given element in the<br>source array. You must execute the method<br>by passing an array, its size and the<br>element to be removed. After calling the<br>method, print the array to show whether all<br>the occurrences of the element have been<br>removed properly. [Use Python & Dont use any built<br>Example:<br>source=[10,2,30,2,50,2,2,60,0,0]<br>removeAll(source,8,2)<br>After calling removeAll(source,8,2), all the<br>function. print, return, append can<br>be used.]<br>occurrences of 2 must be removed.<br>Printing the array afterwards should give<br>the output as:<br>[ 10,30,50,60,0,0,0,0,0,0]<br>

Extracted text: 4. Remove all occurrences of a particular element from an array Consider an array named source. Write a method/function named removeAll( source, size, element) that removes all the occurrences of the given element in the source array. You must execute the method by passing an array, its size and the element to be removed. After calling the method, print the array to show whether all the occurrences of the element have been removed properly. [Use Python & Dont use any built Example: source=[10,2,30,2,50,2,2,60,0,0] removeAll(source,8,2) After calling removeAll(source,8,2), all the function. print, return, append can be used.] occurrences of 2 must be removed. Printing the array afterwards should give the output as: [ 10,30,50,60,0,0,0,0,0,0]

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here