Reference no: EM132399238
1. Explain the output of the following code snippet?
int[] array = new int[25];
array[25] = 2;
2. Describe five operations that can be performed on a list (whether a linear list or array list).
3. How are elements in an array stored in memory and why are they stored like that?
4. An algorithm can be specified in various ways. Identify and explain four ways in which an algorithm can be specified.
5. Discuss the main differences between a simple array A , an Array List AL
6. Given a linked list L how can you determine whether it is a singular linked list or a circular linked list? Give an application for the circular linked list.
7. Why are insertions and deletions at the logical end of the array more efficient than insertions and deletions in the interior of the array?
8. a. Given the following methods from the List interface draw the final state of an initial empty ArrayList AS of student names
AS.add(0,George), AS.add(0,Christie), AS.add(0,Becky), AS.add(2,Aba), AS.remove(1), AS.add(3,Devine), AS.add(0, AS.remove(1))
9. Determine the asymptotic growth rate of the following expressions and justify your answers:
(i). 4n4 + 7n3 + n2 + 3n + 10
(ii). 8n3 + 3nlog n + 5n + 21