I recently attended an interview where I was asked to implement a linked list using an array in Java. I couldn’t think of a decent way to do it. Is there a legitimate way to do that?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You could (for example) have a linked-list of integers by putting your first data item in the element of the array, and the index of the next item in the second element. Although, this would restrict you to storing types that were compatible with/convertible to an index..