Question: by Dimensional Array pls solve all q now argent 1. An array has an index of [8] at the starting address of 300. It has
1. An array has an index of [8] at the starting address of 300. It has 4 words per memory cell, determine loc[2],loc[5] and NE. (3 Marks: 1 mark for each) 2. A 2-D array defined as A[15][8] requires 4 words of storage space for each element. Calculate the address of A[3][4] given the base address as 300 If the array is stored in Row-major form (2 Marks) - If the array is stored in Column-major form (2 Marks) 3. Write a method for the following using the data structure Linked List. int sum(Node list) If the list is (25, 75, 50, 150} then sum(list) will return 300. (5 Marks: 1mark for each correct step) 4. Trace the following code showing the contents of the Linked List L after each call L.add(60); L.add(80); L.addFirst(100); L.addLast(100); L.set(1, 40); L.remove(1); L.remove(2); L.removeFirst(); L.removeLast(); (10 Marks: 1 mark for each correct answer) L.addFirst(10); 5. Compare and contrast the following data structures. (3 Marks) Array and Linked List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
