How to use linked list in Embedded MATLAB Function?

  • Follow


I need to use linked list data structure in Embedded MATLAB Function. Please help me with an example of using linked list in Embedded MATLAB Function.
0
Reply Lee 1/16/2011 4:00:23 PM

"Lee-Min Lee" <lmlee@livemail.tw> wrote in message <igv4mn$bb0$1@fred.mathworks.com>...
> I need to use linked list data structure in Embedded MATLAB Function. Please help me with an example of using linked list in Embedded MATLAB Function.

Beside possibly handle class/subclass in OOP, there is no data structure in Matlab (regular or embedded) remotely equivalent to linked-list.

Bruno
0
Reply Bruno 1/16/2011 4:35:27 PM


On 16/01/11 10:35 AM, Bruno Luong wrote:
> "Lee-Min Lee" <lmlee@livemail.tw> wrote in message
> <igv4mn$bb0$1@fred.mathworks.com>...
>> I need to use linked list data structure in Embedded MATLAB Function.
>> Please help me with an example of using linked list in Embedded MATLAB
>> Function.
>
> Beside possibly handle class/subclass in OOP, there is no data structure
> in Matlab (regular or embedded) remotely equivalent to linked-list.

Nested cell arrays are similar to directed trees, which is one of the 
common linked-list uses. It's not a great solution, but in that 
restricted case there is _something_.

Linked lists of restricted size can be handled the old FORTRAN way, 
using "cursors". That is, build an array to hold the maximum number of 
entries, and at each point there would be a pointer instead put a number 
which is the index of the array item that contains the entry. This 
method is suitable for embedded Matlab if the maximum number of entries 
(and their total size) can be bounded. My understanding of Embedded 
Matlab is that data structures of potentially unlimited size are not 
intended to be possible in the subset.
0
Reply Think 1/16/2011 4:44:12 PM

"Think blue, count two." <roberson@hushmail.com> wrote in message <xfFYo.60982$lL1.2377@newsfe21.iad>...
> On 16/01/11 10:35 AM, Bruno Luong wrote:
> > "Lee-Min Lee" <lmlee@livemail.tw> wrote in message
> > <igv4mn$bb0$1@fred.mathworks.com>...
> >> I need to use linked list data structure in Embedded MATLAB Function.
> >> Please help me with an example of using linked list in Embedded MATLAB
> >> Function.
> >
> > Beside possibly handle class/subclass in OOP, there is no data structure
> > in Matlab (regular or embedded) remotely equivalent to linked-list.
> 
> Nested cell arrays are similar to directed trees, which is one of the 
> common linked-list uses. It's not a great solution, but in that 
> restricted case there is _something_.
> 

CELL and LINK-LIST is not even close in my book. For example:
Insert an element into a head of tail of CELL costs O(N), for LINK-LIST it costs O(1). From that moment, any algorithm specifically developed with LINK-LIST (queue, binary sorting tree, ...) has its complexity fall apart when translated to CELL.

Bruno
0
Reply Bruno 1/16/2011 4:55:04 PM

3 Replies
430 Views

(page loaded in 0.032 seconds)

Similiar Articles:













7/11/2012 9:03:02 PM


Reply: