Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. For each problem description state whether you would want to use an Array, an ArrayList or a LinkedList, and write why your choice would
1. For each problem description state whether you would want to use an Array, an ArrayList or a LinkedList, and write why your choice would be appropriate. You may assume the LinkedList is doubly linked if you wish. Think about the relative strengths and weaknesses of the different kinds of lists. i. You are keeping track of customers at a deli counter (but can't get your hands on one of the cool take a number things). When customers get to the counter, they will put their name at the end of a list. When you help a customer, you will remove their name from the beginning of the list. answer here ii. You want to take a random sample of data from a list. You don't know how much data will be in the list (users will be inputting the data before you get to it). You will get the random sample by choosing a random index between 0 and the list's size 1 and taking the data from that index (repeating many times) answer here iii. Same as 2, but you know there will be 100 pieces of data answer here 2. In what ways is a more efficient/faster than an ArrayList ? 3. In what ways is an more efficient/faster than a 4. In what ways are the and roughly equivalent
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started