GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — algorithms-ts/src/containers/api.ts at 70a28465265a6a8f95cf7585000e34f82c41f4a7 · prishedko/algorithms-ts

Expand file tree

/

api.ts

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
100 lines (97 loc) · 3.97 KB
/

api.ts

Copy path

File metadata and controls

100 lines (97 loc) · 3.97 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import { CommonsAPI } from '../commons/api'
import Collection = CommonsAPI.Collection
/**
* Defines container-like ADTs (stacks, queues, etc.)
*/
export namespace ContainersAPI {
/**
* The <tt>Stack</tt> class represents a last-in-first-out (LIFO) stack of generic items. It supports the usual
* <tt>push</tt> and <tt>pop</tt> operations, along with methods for peeking at the top item. Also it extends
* <tt>Collection</tt> API for iteration and testing whether the <tt>Stack</tt> is empty.
*/
export interface Stack<E> {
/**
* Adds the item to this stack.
* @param {E} element the element to add
* @return {ContainersAPI.Stack<E>} this stack
*/
push(element: E): Stack<E>
/**
* Removes and returns the item most recently added to this stack.
* @return {E} the element most recently added.
* @throws Error('Stack underflow') if this stack is empty
*/
pop(): E
/**
* Returns (but does not remove) the item most recently added to this stack.
* @return {E} the element most recently added to this stack.
* @throws Error('Stack underflow') if this stack is empty
*/
peek(): E
/**
* Returns a string representation of this stack.
* @return {string} the sequence of elements in the stack in LIFO order, separated by spaces
*/
toString(): string
/**
* Returns true if this stack is empty.
* @return {boolean} <code>true</code> if this stack is empty; <code>false</code> otherwise
*/
isEmpty(): boolean
/**
* Returns the number of elements in the stack.
* @return {number} the number of elements in the stack
*/
size(): number
/**
* Returns collection backed by this stack. Iterations will be in LIFO order. Time complexity is O(1).
* @return {CommonsAPI.Collection<E>} collection of elements from this stack.
*/
asCollection(): Collection<E>
}
/**
* The <code>Queue</code> class represents a first-in-first-out (FIFO) queue of generic elements. It supports the
* usual <tt>enqueue</tt> and <tt>dequeue</tt> operations, along with methods for peeking at the first item,
* testing if the queue is empty, and iterating through the items in FIFO order.
*/
export interface Queue<E> {
/**
* Returns <code>true</code> if this queue is empty.
* @return {boolean} <code>true</code> if this queue is empty; <code>false</code> otherwise
*/
isEmpty(): boolean
/**
* Returns the number of elements in this queue.
* @return {number} the number of elements in this queue.
*/
size(): number
/**
* Returns the element least recently added to this queue.
* @return {E} the element least recently added to this queue.
* @throws Error('Queue underflow') if this queue is empty.
*/
peek(): E
/**
* Adds the element to this queue.
* @param {E} e element the item to add.
* @return {ContainersAPI.Queue<E>} queue with the added element.
*/
enqueue(e: E): Queue<E>
/**
* Removes and returns the element on this queue that was least recently added.
* @return {E} the element on this queue that was least recently added.
* @throws Error('Queue underflow') if this queue is empty.
*/
dequeue(): E
/**
* Returns a string representation of this queue.
* @return {string} the sequence of elements in FIFO order, separated by spaces.
*/
toString(): string
/**
* Returns collection backed by this queue. Iterations will be in FIFO order. Time complexity is O(1).
* @return {CommonsAPI.Collection<E>} collection of elements from this queue.
*/
asCollection(): Collection<E>
}
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.