Data Structures in MATLAB

32 次查看(过去 30 天)
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
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 CenterFile Exchange 中查找有关 Structures 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by