Data Structure: A Cell Array List Container

Provides a useful 1D container for storing an ordered heterogeneous set of elements
ダウンロード: 1.6K
更新 2016/9/1

ライセンスの表示

Intent: Provides a useful 1D data structure (or container) for storing an ordered heterogeneous set of elements.
Motivation: MATLAB® R2009a provides the "containers.Map" data structure for storing an unordered heterogeneous set of elements - the Map ADT is a container that is indexed with a "key" of any data type. A List ADT is a data container that is indexed by integers. The benefit in using a List ADT opposed to a native MATLAB cell array is the List ADT hides the complexity in implementation of the operations you would perform to insert and remove elements in/from arbitrary positions, for example.

Implementation: Class 'CellArrayList' is a concrete realisation of the the List ADT which uses a "native" MATLAB cell array as its storage mechanism.

The source files are contained in the zip file 'CellArrayList.zip'. Refer to the comments in 'List.m' and 'CellArrayList.m' for full details on the motivation and implementation. The script 'testCellArrayList.m' demonstrates the use of 'CellArrayList.m'. Further, a corresponding UML class diagram is illustrated in 'CellArrayList_UML_Diagram.pdf'.

Written by Bobby Nedelkovski
MathWorks Australia
Copyright 2009-2010, The MathWorks, Inc.

引用

Bobby Nedelkovski (2026). Data Structure: A Cell Array List Container (https://jp.mathworks.com/matlabcentral/fileexchange/25024-data-structure-a-cell-array-list-container), MATLAB Central File Exchange. 取得日: .

MATLAB リリースの互換性
作成: R2010a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersDictionaries についてさらに検索
謝辞

ヒントを与えたファイル: Design Pattern: Iterator (Behavioural)

バージョン 公開済み リリース ノート
1.5.0.1

Updated license

1.5.0.0

Bug fix to allow creation of N-D arrays of CellArrayLists - see my comment under 'Comments and Ratings' on '11 Apr 2010'. All methods including overloaded system functions 'isempty', 'length' and 'display' have been updated in class CellArrayList.

1.4.0.0

Bug fix (much thanks to João Henriques) to avoid infinite while-loop in add() method when capacity reaches 0. Added constant property INITIAL_CAPACITY due to bug fix. UML Diagram has been updated to reflect the change.

1.3.0.0

Property 'numElts' changed to concrete protected in abstract class List - conforms with R2009b OOP. Updated UML diagram to reflect this change. Bug fix with remove() method in CellArrayList.

1.2.0.0

Minor fix in comments of 'testCellArrayList.m'. Removed abstract declaration 'list' from abstract class 'List' as this presumes a List ADT is implemented using a flat array-like data structure. UML Diagram has been updated to reflect the change.

1.1.0.0

Minor fix in comments of 'testCellArrayList.m'. Removed abstract declaration 'list' from abstract class 'List' as this presumes a List ADT is implemented using a flat array-like data structure. UML Diagram has been updated to reflect the change.

1.0.0.0