package adt
- Alphabetic
- Public
- All
Type Members
-
trait
Bag
[A] extends Iterable[A]
Provides a bag (or multiset) of generic items, supporting insertion and iterating over the items in arbitrary order.
Provides a bag (or multiset) of generic items, supporting insertion and iterating over the items in arbitrary order.
Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
abstract
class
HeapPriorityQueue
[Key] extends ResizingArrayPriorityQueue[Key]
This abstract class represents a priority queue of generic keys.
This abstract class represents a priority queue of generic keys. It supports the usual insert and delete operations, along with methods for peeking at the highest-priority key, testing if the priority queue is empty, and iterating through the keys.
The super trait
PriorityQueue
supports both minimum and maximum priority-key implementations by means of theht
method.This implementation uses a binary heap based on a resizing array. Enqueuing and dequeuing operations take logarithmic amortized time. The peek, size, and isEempty operations take constant time.
Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 2.4 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
abstract
class
IndexPriorityQueue
[Key] extends Iterable[Key]
This abstract class represents an indexed priority queue of generic keys.
This abstract class represents an indexed priority queue of generic keys. It supports the usual insert and delete operations, along with methods for changing a given key, peeking at the highest-priority key, testing if the priority queue is empty, and iterating through the keys.
In order to let the client refer to items on the priority queue, an integer between 0 and length-1 is associated with each key;the client uses this integer to specify which key to delete or change.
This implementation uses a binary heap along with additional arrays to associate keys with integers in the given range.
The insert, delete and change-key, operations take logarithmic time. The is-empty, size, highest-index, highest-key and key-of operations take constant time. Construction takes time proportional to the specified capacity.
This abstract class supports both minimum and maximum priority-key implementations by means of the
ht
method.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 2.4 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
class
LinkedBag
[A] extends Bag[A]
Provides a bag (or multiset) of generic items, supporting insertion and iterating over the items in arbitrary order.
Provides a bag (or multiset) of generic items, supporting insertion and iterating over the items in arbitrary order.
This implementation uses a singly-linked list. The
add
,isEmpty
, andsize
operations take constant time. Iteration takes time proportional to the number of items.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
- trait LinkedPriorityQueue [Key] extends PriorityQueue[Key]
-
class
LinkedQueue
[A] extends Queue[A]
Provides a FIFO queue of generic items, supporting
enqueue
anddequeue
operations, along with methods for peeking at the first item,Provides a FIFO queue of generic items, supporting
enqueue
anddequeue
operations, along with methods for peeking at the first item,This implementation uses a singly-linked list. The
enqueue
,dequeue
,peek
,size
, andisEmpty
operations all take constant time in the worst case. Iteration takes time proportional to the number of items.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
class
LinkedStack
[A] extends Stack[A]
Provides a LIFO stack of generic items, supporting
push
andpop
operations, along with methods for peeking at the top item, testing if the stack is empty, and iterating through the items in LIFO order.Provides a LIFO stack of generic items, supporting
push
andpop
operations, along with methods for peeking at the top item, testing if the stack is empty, and iterating through the items in LIFO order.This implementation uses a singly-linked list. The
push
,pop
,peek
,size
, andisEmpty
operations all take constant time in the worst case. Iteration takes time proportional to the number of items.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
- abstract class OrderedLinkedPriorityQueue [Key] extends LinkedPriorityQueue[Key]
- abstract class OrderedResizingArrayPriorityQueue [Key] extends ResizingArrayPriorityQueue[Key]
-
trait
PriorityQueue
[Key] extends Iterable[Key]
This trait represents a priority queue of generic keys.
This trait represents a priority queue of generic keys. It supports the usual insert and delete operations, along with methods for peeking at the highest-priority key, testing if the priority queue is empty, and iterating through the keys.
This trait supports both minimum and maximum priority-key implementations by means of the
ht
method.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 2.4 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
trait
Queue
[A] extends Iterable[A]
Provides a FIFO queue of generic items, supporting
enqueue
anddequeue
operations, along with methods for peeking at the first item, testing if the queue is empty, and iterating through the items in FIFO order.Provides a FIFO queue of generic items, supporting
enqueue
anddequeue
operations, along with methods for peeking at the first item, testing if the queue is empty, and iterating through the items in FIFO order.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
class
ResizingArrayBag
[A] extends Bag[A]
Provides a bag (or multiset) of generic items, supporting insertion and iterating over the items in arbitrary order.
Provides a bag (or multiset) of generic items, supporting insertion and iterating over the items in arbitrary order.
This implementation uses a resizing array. The
add
operation takes constant amortized time; theisEmpty
, andsize
operations take constant time. Iteration takes time proportional to the number of items.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
- abstract class ResizingArrayPriorityQueue [Key] extends PriorityQueue[Key]
-
class
ResizingArrayQueue
[A] extends Queue[A]
Provides a FIFO queue of generic items, supporting
enqueue
anddequeue
operations, along with methods for peeking at the first item,Provides a FIFO queue of generic items, supporting
enqueue
anddequeue
operations, along with methods for peeking at the first item,This implementation uses a resizing array, which doubles the underlying array when it is full and halves the underlying array when it is one-quarter full. The
enqueue
anddequeue
operations take constant amortized time. Thesize
,peek
, andisEmpty
operations take constant time in the worst case. Iteration takes time proportional to the number of items.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
class
ResizingArrayStack
[A] extends Stack[A]
Provides a LIFO stack of generic items, supporting
push
andpop
operations, along with methods for peeking at the top item, testing if the stack is empty, and iterating through the items in LIFO order.Provides a LIFO stack of generic items, supporting
push
andpop
operations, along with methods for peeking at the top item, testing if the stack is empty, and iterating through the items in LIFO order.This implementation uses a resizing array, which doubles the underlying array when it is full and halves the underlying array when it is one-quarter full. The
push
andpop
operations take constant amortized time. Thesize
,peek
, andisEmpty
operations take constant time in the worst case. Iteration takes time proportional to the number of items.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
-
trait
Stack
[A] extends Iterable[A]
Provides a LIFO stack of generic items, supporting
push
andpop
operations, along with methods for peeking at the top item, testing if the stack is empty, and iterating through the items in LIFO order.Provides a LIFO stack of generic items, supporting
push
andpop
operations, along with methods for peeking at the top item, testing if the stack is empty, and iterating through the items in LIFO order.Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.
- See also
Section 1.3 of Algorithms, 4th Edition
Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu
- abstract class UnorderedLinkedPriorityQueue [Key] extends LinkedPriorityQueue[Key]
- abstract class UnorderedResizingArrayPriorityQueue [Key] extends ResizingArrayPriorityQueue[Key]
Value Members
- object Bag
- object IndexPriorityQueue
- object LinkedBag
- object LinkedPriorityQueue
- object LinkedQueue
- object LinkedStack
- object PriorityQueue
- object Queue
- object ResizingArrayBag
- object ResizingArrayQueue
- object ResizingArrayStack
- object Stack