#Is my linked list "ADT"?
1 messages · Page 1 of 1 (latest)
What does ADT mean to you?
abstract data type
and i assume since i can use any datatype to plug into my linked list that it would be "ADT" but im just confused
ADT has another meaning
Algebraic Data Type
it is that
specifically your list is a sum type
data List a = Empty | NotEmpty a (List a)
and the NotEmpty type is a product type
while the Empty type is a unit type
it is an algebraic data type
it is also "abstract" in some ways
both over the kinds of elements it can contain and the contract it gives to users
is the javas linkedlist library thing considered adt too?
java's linkedlist is not an algebraic data type
because of this stuff?
yeah
because you modeled it as either empty or not empty
"abstract data type" is a term with a lot looser of a definition
isnt that just another way of saying is polymorphic?
yes
hmm
also, would it be wise to use "map" to go through my whole linked list to encrypt it?