Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Dynamic Array You need to understand the implementation of this data structure, especially for the methods, such as get, set, append, insert, remove, and

image text in transcribedimage text in transcribed

1. Dynamic Array You need to understand the implementation of this data structure, especially for the methods, such as get, set, append, insert, remove, and resize. Exam question example: the current version of dynamic array will double its capacity when the array is full. If we want it to shrink its size when it has fewer elements, what methods of the dynamic array need to be changed? 2. Singly Linked List You need to understand the implementation of Singly Linked List, and you need to know how to navigate a Singly Linked List. Exam question example: suppose we have a singly linked list, which has more than two integers. Please finish the following method to find the first number that's not in ascending order. For example, given a list {1, 2, 3, 4, 4, 1, 2,3}, the method should return 5, because at index 5, 1 is less than the previous node. If the list is in ascending order, the method should return -1. Exam question example: Compare the get method of dynamic array and the get method of Singly Linked List, which method is faster? Why? 3. Doubly Linked List You need to understand the implementation of Doubly Linked List, and you need to know how to navigate a Doubly Linked List. Exam question example: suppose we have a doubly linked list, which has more than three nodes. Please finish the following method to replace the second node with the given node, newNode. Write an efficient algorithm (similar to the array-based algorithm for Fibonacci) to calculate the number sequence L(n) 7. GCD You need to understand the algorithm of Eculidean GCD. Exam question example: What's the activation tree for EuclideanGCD(6885421, 2379596)? Exam question example: If GCD(3461, 1235912) takes a second to get the result, how long would GCD(3461000, 1235912000) take to get the result

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions