Exercises for Chapter #1 of A Common-Sense Guide To Data Structures and Algorithms

Get The Book!For an array with a size of 100 elements, provide the number of steps that the following operations would take for:

- Reading
- Searching
- Insertion at the very beginning of the array
- Insertion at the very end of the array
- Deletion at the very beginning of the array
- Insertion at the very end of the array

For an array-based *set* with a size of 100 elements, provide the number of steps that the following operations would take for:

- Reading
- Searching
- Insertion at the very beginning of the set
- Insertion at the very end of the set
- Deletion at the very beginning of the set
- Insertion at the very end of the set

For a regular array, how many steps would it take to search for all of a certain item. For example, we want to search for every 55 contained within an array to determine how many times it appears. Give your answer in terms of N.

How many steps would it take to delete all the 72’s from the following array: [72, 44, 66, 2019, 72, 55, 101, 72, 99, 2]. (The array would become [44, 66, 2019, 55, 101, 99, 2].)

How many steps would it take to insert a 44 at both the beginning and end of the following array: [5, 6, 7, 8, 9, 10]. (The insertions would turn the array into: [44, 5, 6, 7, 8, 9, 10, 44].)

Use your favorite object-oriented programming language to create a class that represents an array-based set. It should include functions/methods that serve as the key operations: Read, search, insert, and delete. Ensure that the insert operation will not insert duplicate values.