Data Structures in MATLAB

35 ビュー (過去 30 日間)
Erik Johannes Loo
Erik Johannes Loo 2021 年 12 月 6 日
コメント済み: Erik Johannes Loo 2022 年 7 月 11 日
Hello, I hope this is an appropriate question to ask in here.
As part of continous learning, I took a course on ordered/unordered data structures and I will present the key points to my co-workers (different types of data structures, use cases, etc).
We mostly use MATLAB, so I was looking for pointers to make my presentation more appropriate.
As far as I know:
arrays/vectors are represented by MATLAB matrices
stacks/queues would also be represented by MATLAB matrices
lists - do they have a native representation?
hash tables (unordered maps) are represented by Containers.Map
binary trees (binary searcht trees, red-black trees, ordered maps/sets/dicts) - do they have a native representation?
min/max-heap - do they have a native representation?
graphs - I suppose it makes sense to manually implement graphs.
Conversely:
cell arrays - what are they / how are they implemented?
tables - what are they / how are they implemented?
I know this is a bit of a "theoretical" question but I would be very grateful to get some answers or be pointed towards documentation as I would not like to present erroneous information.

採用された回答

Bharat Chandra Mukkavalli
Bharat Chandra Mukkavalli 2022 年 7 月 11 日
Hi,
To answer your query,
1) MATLAB does not have a "list" data class.
2) Trees are present in MATLAB in the "NTREE" class, the documentation can be found here: https://in.mathworks.com/help/wavelet/ref/ntree.html
3) Heaps Class is present in MATLAB and internally I believe max-heap is implemented, the implementation can be found here: https://in.mathworks.com/matlabcentral/fileexchange/34218-heap
4) MATLAB has the "graph" class to implement the graph data structure, the documentation can be found here: https://in.mathworks.com/help/matlab/ref/graph.html
5) Here is the documentation of Cell Arrays in MATLAB: https://in.mathworks.com/help/matlab/cell-arrays.html?s_tid=CRUX_topnav
6) Here is the documentation of Tables in MATLAB: https://in.mathworks.com/help/matlab/tables.html
Hope this helps!
  1 件のコメント
Erik Johannes Loo
Erik Johannes Loo 2022 年 7 月 11 日
Thanks, I asked this same question in reddit a while back and it seems few people actually know the existence of trees, heaps and graphs in MATLAB (myself included).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStructures についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by