Data Structures in MATLAB

조회 수: 31 (최근 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 CenterFile Exchange에서 Structures에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by