Computer Science, asked by luthra3561, 5 months ago

Consider the array size as 10.there are 6 element ina array . The value at aindex is 7 is tone deleted . What will be happen ?

Answers

Answered by pinkigupta822113
1

Answer:

Given an array and a number ‘x’, write a function to delete ‘x’ from the given array. We assume that array maintains two things with it, capacity and size. So when we remove an item, capacity does not change, only size changes.

Example:

Input: arr[] = {3, 1, 2, 5, 90}, x = 2, size = 5, capacity = 5

Output: arr[] = {3, 1, 5, 90, _}, size = 4, capacity = 5

Input: arr[] = {3, 1, 2, _, _}, x = 2, size = 3, capacity = 5

Output: arr[] = {3, 1, _, _, _}, size = 4, capacity = 5

Explanation:

I hope it's help you☺☺☺

Similar questions