adt 1.0.2

Abstract Data Types

Linux macOS Windows



Description

Abstract Data Types (ADT) module. This module currently provides Queue and Stack. You can individually import Queue or Stack by using import statement: import adt/queue or import adt/stack.

Installation
Use Dima to install or update this module:
$ dima install adt


Usage Examples
' Queue example
 
import adt/queue
 
queue = queue()
 
queue.push(10)
queue.push(12)
queue.push(8)
 
while !queue.isempty()
    writeln(queue.pop())
endwhile
 
' Output:
' 10
' 12
' 8
' Stack example
 
import adt/stack
 
stack = stack()
 
stack.push(10)
stack.push(12)
stack.push(8)
 
while !stack.isempty()
    writeln(stack.pop())
endwhile
 
' Output:
' 8
' 12
' 10
' Queue and Stack example
 
import adt
 
queue = queue()
stack = stack()
 
queue.push(10)
queue.push(12)
queue.push(8)
 
stack.push(10)
stack.push(12)
stack.push(8)
 
while !queue.isempty()
    writeln(queue.pop())
endwhile
 
while !stack.isempty()
    writeln(stack.pop())
endwhile


Changelog
See Changelog


Module Info
Author: @faruq (Muhammad Faruq Nuruddinsyah)
URL: https://dinfio.org/
Documentation: Module Reference
Updated on: 31 July 2024