DataStructure/Roles.pm untested

filter: Statementstmt n/a Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a SCAR -
1 package DataStructure::Roles;
2  
3 =pod
4  
5 =over 4
6  
7 =item DataStructure::Queue
8  
9 Implemented by L<DataStructure::LinkedList> and L<DataStructure::DoubleList>
10  
11 Has the following methods C<shift()>, C<push($value)>, C<values()>, C<empty()>, C<size()>.
12  
13 Nodes have the following methods: C<value()>.
14  
15 Synonym: C<DataStructure::FIFO>.
16  
17 =item DataStructure::Stack
18  
19 Implemented by L<DataStructure::LinkedList> (with the C<reverse> option) and
20 L<DataStructure::DoubleList>.
21  
22 Has the following methods C<first()>, C<push($value)>, C<pop()>, C<values()>,
23 C<empty()>, C<size()>.
24  
25 Nodes have the following methods: C<value()>, C<insert_after($value)>, C<next()>.
26  
27 Note that, without the C<reverse> option a L<DataStructure::LinkedList> can also
28 behave like a stack but you would need to use the less common C<shift> and
29 C<unshift> pair of methods.
30  
31 Synonym: C<DataStructure::LIFO>.
32  
33 =item DataStructure::OrderedSet
34  
35 Implemented by L<DataStructure::BTree>
36  
37 Has the following methods C<insert($value)>, C<find($value)>,
38 C<delete($value | $node)>, C<values()>, C<empty()>, C<size()>.
39  
40 =back
41  
42 =cut
43  
44 1;