abstract-data-type
Combining two separate ADTs into one
Hey guys I\'m trying to get started on my CS assignment (second year C paper). In this course we have created a Binary Search Tree ADT and also a Red Black Tree ADT. We have to combine them into one[详细]
2023-04-09 00:05 分类:问答How to mix Generics and Abstract Types in Scala?
I want to do the following, but \"Iterable[BASE]\" won\'t compile. What i开发者_如何学运维s the right way to do it, while keeping BASE an abstract type?[详细]
2023-03-27 20:02 分类:问答Is Linked List an ADT or is it a Data Structure, or both?
If I use the standard definition of an Abstract Data Type as a black box that provides some functions to manage a collection of data, a Linked List fits that description:[详细]
2023-03-17 00:21 分类:问答Container ADT standard operation
If you look at the Container ADT (abstract data type) as a black box, it provides two functions: 1. put(C, x)[详细]
2023-03-16 13:24 分类:问答Time complexity of a Stack ADT implemented using a Linked List
What is the time complexity of the put(x) and get() functions for a Stack abstract data type that is implemented using a LinkedList?[详细]
2023-03-16 06:41 分类:问答Can I import a non-abstract type abstractly?
Suppose I have a module that contains a type: module My where data L a = Nil | Cons a (L a) The module exports the concrete definition of My to allow for pattern matchi开发者_C百科ng etc.[详细]
2023-03-15 02:27 分类:问答Transform Parameterized Type (With Inferred Parameter)
I have a data type which carries a \'hidden\' (inferred) type and a concrete value. Now I try to implement a function which changes both of these but am unable to make it pass GHC.[详细]
2023-03-02 07:20 分类:问答Creating instances of Abstract Data Types that recursively contain each other
Given two date types defined as follows: data Foo = Foo Bar String data Bar = Bar Foo String How can I make foo and bar s开发者_如何学Gouch that foo is Foo bar \"foo\" and bar is Bar foo \"bar\"?[详细]
2023-03-01 16:43 分类:问答OO Interface translation to Haskell
My specific problem is actually not about the general translation of an OO interface to Haskell. This is just the best title I could come up with. Yet, I\'m sure that my problem originates from a stil[详细]
2023-02-20 18:01 分类:问答Is "node" an ADT? If so, what is its interface?
Nodes are useful for implementing ADTs, but is \"node\" itself an ADT? How does one implement \"node\"? Wikipedia uses a plain old struct with no methods in its (brief) articl开发者_C百科e on nodes. I[详细]
2023-01-29 19:18 分类:问答