Consider a function called insertelementatlocation in an


Question 1 : Consider a function called insertElementAtLocation() in an array based list data structure. The function will insert an element in an array by shifting the elements in the array down by one position at a given location to make room for the new element. It will then place the new element in this location.

This function could work fine for small array based lists; however, it would be very inefficient for large lists.

Briefly explain how this same function could be implemented more efficiently using a linked list implementation that uses pointers. 

Question 2 : When considering the push() and pop() operations for a stack, briefly describe how a compiler program could use a stack to implement delimiter matching. For example, matching delimiter strings could be: "{", "}", "(", ")", and "/*", and "*/".

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Consider a function called insertelementatlocation in an
Reference No:- TGS01164417

Expected delivery within 24 Hours