how do I create an array of linked lists?

Is it possible to create an array of dlnodes? The aim is to sort data into groups with unknown size And to allow easy access to each list, using the array coordinates.
Some guidelines, a sample code or even an idea with different approach will be great
Thanks Nitz

답변 (1개)

Andrew Newell
Andrew Newell 2011년 5월 1일

1 개 추천

EDIT: To make an array of dlnodes, I suggest copying dlnode to dlnodeArray and changing dlnode to dlnodeArray within the file. Then you can modify the methods to get the behavior you want. But first you'll need to decide how exactly you want it to behave - for example, what do you want disp to display? Do you want to initialize it with a matrix input? Etc.

댓글 수: 2

nitz
nitz 2011년 5월 2일
no, sorry, allow me to rephrase:
can I create a matrix that stores in every coordinate a dlnode class that will be used as a head for a linked list?
Andrew Newell
Andrew Newell 2011년 5월 2일
As requested, I gave you a link to some sample code. The rest is up to you (although I have added a suggestion for how to get going above). I can't write it for you because (a) I don't have the time, and (b) there are decisions you'll have to make about how the methods behave.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

제품

질문:

2011년 5월 1일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by