Shellscriptbeginner
Shellscriptbeginner

Reputation: 917

what is the name of this data structure

   (10)
   /  \
 (9)  (8)
 /  \ /  \
(7) (5) (4) 

x        x
/   and  \    == x=>y
y         y

Upvotes: 1

Views: 247

Answers (2)

interjay
interjay

Reputation: 110191

That looks like a max-heap, except that (5) should not be attached to two parents.

A max-heap is a tree-based data structure where x>=y if x is a parent of y. Since it is a tree, each child can only have one parent.

Upvotes: 5

Wim
Wim

Reputation: 11252

It's a directed acyclic graph (DAG), which can define a (partial) ordering relation.

Upvotes: 5

Related Questions