|
|||||||||
PREV NEXT | FRAMES NO FRAMES |
Uses of Position in net.datastructures |
---|
Subinterfaces of Position in net.datastructures | |
---|---|
interface |
BTPosition<E>
Interface for a node of a binary tree. |
interface |
DecorablePosition<E>
An interface for a position that can be marked with an arbitrary number of decorations. |
interface |
Edge<E>
An interface for an edge of a graph. |
interface |
TreePosition<E>
Interface for a node of a binary tree. |
interface |
Vertex<E>
An interface for a vertex of a graph. |
Classes in net.datastructures that implement Position | |
---|---|
class |
BTNode<E>
Class implementing a node of a binary tree by storing references to an element, a parent node, a left node, and a right node. |
class |
DNode<E>
A simple node class for a doubly-linked list. |
class |
TreeNode<E>
Class implementing a node of a binary tree by storing references to an element, a parent node, a left node, and a right node. |
Methods in net.datastructures that return Position | |
---|---|
Position<E> |
CompleteBinaryTree.add(E elem)
Adds an element to the tree just after the last node. |
Position<E> |
ArrayListCompleteBinaryTree.add(E e)
Adds an element just after the last node (in a level numbering). |
Position<E> |
LinkedTree.addRoot(E e)
Adds a root node to an empty tree |
Position<E> |
LinkedBinaryTree.addRoot(E e)
Adds a root node to an empty tree |
Position<E> |
Sequence.atIndex(int r)
Returns the position containing the element at the given index. |
Position<E> |
PositionList.first()
Returns the first node in the list. |
Position<E> |
NodePositionList.first()
Returns the first position in the list; O(1) time |
Position<E> |
LinkedBinaryTree.insertLeft(Position<E> v,
E e)
Inserts a left child at a given node. |
Position<E> |
LinkedBinaryTree.insertRight(Position<E> v,
E e)
Inserts a right child at a given node. |
Position<E> |
PositionList.last()
Returns the last node in the list. |
Position<E> |
NodePositionList.last()
Returns the last position in the list; O(1) time |
Position<E> |
LinkedBinaryTree.left(Position<E> v)
Returns the left child of a node. |
Position<E> |
BinaryTree.left(Position<E> v)
Returns the left child of a node. |
Position<E> |
ArrayListCompleteBinaryTree.left(Position<E> v)
Returns the left child of v. |
Position<E> |
PositionList.next(Position<E> p)
Returns the node after a given node in the list. |
Position<E> |
NodePositionList.next(Position<E> p)
Returns the position after the given one; O(1) time |
Position<E> |
Tree.parent(Position<E> v)
Returns the parent of a given node. |
Position<E> |
LinkedTree.parent(Position<E> v)
Returns the parent of a node. |
Position<E> |
LinkedBinaryTree.parent(Position<E> v)
Returns the parent of a node. |
Position<E> |
ArrayListCompleteBinaryTree.parent(Position<E> v)
Returns the parent of v. |
Position<E> |
PositionList.prev(Position<E> p)
Returns the node before a given node in the list. |
Position<E> |
NodePositionList.prev(Position<E> p)
Returns the position before the given one; O(1) time |
Position<E> |
LinkedBinaryTree.right(Position<E> v)
Returns the right child of a node. |
Position<E> |
BinaryTree.right(Position<E> v)
Returns the right child of a node. |
Position<E> |
ArrayListCompleteBinaryTree.right(Position<E> v)
Returns the right child of v. |
Position<E> |
Tree.root()
Returns the root of the tree. |
Position<E> |
LinkedTree.root()
Returns the root of the tree. |
Position<E> |
LinkedBinaryTree.root()
Returns the root of the tree. |
Position<E> |
ArrayListCompleteBinaryTree.root()
Returns the root of the tree. |
Position<E> |
LinkedBinaryTree.sibling(Position<E> v)
Return the sibling of a node |
Position<E> |
ArrayListCompleteBinaryTree.sibling(Position<E> v)
Returns the sibling of v. |
Methods in net.datastructures that return types with arguments of type Position | |
---|---|
java.lang.Iterable<Position<E>> |
Tree.children(Position<E> v)
Returns an iterable collection of the children of a given node. |
java.lang.Iterable<Position<E>> |
LinkedTree.children(Position<E> v)
Returns an iterable collection of the children of a node. |
java.lang.Iterable<Position<E>> |
LinkedBinaryTree.children(Position<E> v)
Returns an iterable collection of the children of a node. |
java.lang.Iterable<Position<E>> |
ArrayListCompleteBinaryTree.children(Position<E> v)
Returns an iterable collection of the children of v. |
java.lang.Iterable<Position> |
FindPathDFS.finalResult(java.lang.Iterable<Position> r)
|
java.lang.Iterable<Position> |
FindCycleDFS.finalResult(java.lang.Iterable<Position> r)
|
PositionList<Position<E>> |
TreePosition.getChildren()
Returns the children of this position |
PositionList<Position<E>> |
TreeNode.getChildren()
Returns the children of this position |
java.lang.Iterable<Position<E>> |
Tree.positions()
Returns an iterable collection of the the nodes. |
java.lang.Iterable<Position<E>> |
PositionList.positions()
Returns an iterable collection of all the nodes in the list. |
java.lang.Iterable<Position<E>> |
NodePositionList.positions()
Returns an iterable collection of all the nodes in the list. |
java.lang.Iterable<Position<E>> |
LinkedTree.positions()
Returns an iterable collection of the tree nodes. |
java.lang.Iterable<Position<E>> |
LinkedBinaryTree.positions()
Returns an iterable collection of the tree nodes. |
java.lang.Iterable<Position<E>> |
ArrayListCompleteBinaryTree.positions()
Returns an iterable collection of all the nodes in the tree. |
Methods in net.datastructures with parameters of type Position | ||
---|---|---|
void |
PositionList.addAfter(Position<E> p,
E e)
Inserts an element after the given node in the list. |
|
void |
NodePositionList.addAfter(Position<E> p,
E element)
Insert the given element after the given position; O(1) time |
|
void |
PositionList.addBefore(Position<E> p,
E e)
Inserts an element before the given node in the list. |
|
void |
NodePositionList.addBefore(Position<E> p,
E element)
Insert the given element before the given position; O(1) time |
|
void |
LinkedBinaryTree.attach(Position<E> v,
BinaryTree<E> T1,
BinaryTree<E> T2)
Attaches two trees to be subtrees of an external node. |
|
java.lang.Iterable<Position<E>> |
Tree.children(Position<E> v)
Returns an iterable collection of the children of a given node. |
|
java.lang.Iterable<Position<E>> |
LinkedTree.children(Position<E> v)
Returns an iterable collection of the children of a node. |
|
java.lang.Iterable<Position<E>> |
LinkedBinaryTree.children(Position<E> v)
Returns an iterable collection of the children of a node. |
|
java.lang.Iterable<Position<E>> |
ArrayListCompleteBinaryTree.children(Position<E> v)
Returns an iterable collection of the children of v. |
|
void |
LinkedBinaryTree.expandExternal(Position<E> v,
E l,
E r)
Expand an external node into an internal node with two external node children |
|
boolean |
LinkedBinaryTree.hasLeft(Position<E> v)
Returns whether a node has a left child. |
|
boolean |
BinaryTree.hasLeft(Position<E> v)
Returns whether a node has a left child. |
|
boolean |
ArrayListCompleteBinaryTree.hasLeft(Position<E> v)
Returns whether v has a left child. |
|
boolean |
LinkedBinaryTree.hasRight(Position<E> v)
Returns whether a node has a right child. |
|
boolean |
BinaryTree.hasRight(Position<E> v)
Returns whether a node has a right child. |
|
boolean |
ArrayListCompleteBinaryTree.hasRight(Position<E> v)
Returns whether v has a right child. |
|
int |
Sequence.indexOf(Position<E> p)
Returns the index of the element stored at the given position. |
|
Position<E> |
LinkedBinaryTree.insertLeft(Position<E> v,
E e)
Inserts a left child at a given node. |
|
Position<E> |
LinkedBinaryTree.insertRight(Position<E> v,
E e)
Inserts a right child at a given node. |
|
boolean |
Tree.isExternal(Position<E> v)
Returns whether a given node is external. |
|
boolean |
LinkedTree.isExternal(Position<E> v)
Returns whether a node is external. |
|
boolean |
LinkedBinaryTree.isExternal(Position<E> v)
Returns whether a node is external. |
|
boolean |
ArrayListCompleteBinaryTree.isExternal(Position<E> v)
Returns whether v is an external node. |
|
boolean |
NodePositionList.isFirst(Position<E> p)
Returns whether a position is the first one; O(1) time |
|
boolean |
Tree.isInternal(Position<E> v)
Returns whether a given node is internal. |
|
boolean |
LinkedTree.isInternal(Position<E> v)
Returns whether a node is internal. |
|
boolean |
LinkedBinaryTree.isInternal(Position<E> v)
Returns whether a node is internal. |
|
boolean |
ArrayListCompleteBinaryTree.isInternal(Position<E> v)
Returns whether v is an internal node. |
|
boolean |
NodePositionList.isLast(Position<E> p)
Returns whether a position is the last one; O(1) time |
|
boolean |
Tree.isRoot(Position<E> v)
Returns whether a given node is the root of the tree. |
|
boolean |
LinkedTree.isRoot(Position<E> v)
Returns whether a node is the root. |
|
boolean |
LinkedBinaryTree.isRoot(Position<E> v)
Returns whether a node is the root. |
|
boolean |
ArrayListCompleteBinaryTree.isRoot(Position<E> v)
Returns whether v is the root node. |
|
Position<E> |
LinkedBinaryTree.left(Position<E> v)
Returns the left child of a node. |
|
Position<E> |
BinaryTree.left(Position<E> v)
Returns the left child of a node. |
|
Position<E> |
ArrayListCompleteBinaryTree.left(Position<E> v)
Returns the left child of v. |
|
Position<E> |
PositionList.next(Position<E> p)
Returns the node after a given node in the list. |
|
Position<E> |
NodePositionList.next(Position<E> p)
Returns the position after the given one; O(1) time |
|
Position<E> |
Tree.parent(Position<E> v)
Returns the parent of a given node. |
|
Position<E> |
LinkedTree.parent(Position<E> v)
Returns the parent of a node. |
|
Position<E> |
LinkedBinaryTree.parent(Position<E> v)
Returns the parent of a node. |
|
Position<E> |
ArrayListCompleteBinaryTree.parent(Position<E> v)
Returns the parent of v. |
|
Position<E> |
PositionList.prev(Position<E> p)
Returns the node before a given node in the list. |
|
Position<E> |
NodePositionList.prev(Position<E> p)
Returns the position before the given one; O(1) time |
|
E |
PositionList.remove(Position<E> p)
Removes a node from the list, returning the element stored there. |
|
E |
NodePositionList.remove(Position<E> p)
Remove the given position from the list; O(1) time |
|
E |
LinkedBinaryTree.remove(Position<E> v)
Removes a node with zero or one child. |
|
void |
LinkedBinaryTree.removeAboveExternal(Position<E> v)
Remove an external node v and replace its parent with v's sibling |
|
E |
Tree.replace(Position<E> v,
E e)
Replaces the element stored at a given node. |
|
E |
LinkedTree.replace(Position<E> v,
E o)
Replaces the element at a node. |
|
E |
LinkedBinaryTree.replace(Position<E> v,
E o)
Replaces the element at a node. |
|
E |
ArrayListCompleteBinaryTree.replace(Position<E> v,
E o)
Replaces the element at v. |
|
|
AdjacencyListGraph.replace(Position<T> p,
T o)
Replace the element a given position (vertex or edge) with a new element and return the old element |
|
Position<E> |
LinkedBinaryTree.right(Position<E> v)
Returns the right child of a node. |
|
Position<E> |
BinaryTree.right(Position<E> v)
Returns the right child of a node. |
|
Position<E> |
ArrayListCompleteBinaryTree.right(Position<E> v)
Returns the right child of v. |
|
E |
PositionList.set(Position<E> p,
E e)
Replaces the element stored at the given node, returning old element. |
|
E |
NodePositionList.set(Position<E> p,
E element)
Replace the element at the given position with the new element and return the old element; O(1) time |
|
Position<E> |
LinkedBinaryTree.sibling(Position<E> v)
Return the sibling of a node |
|
Position<E> |
ArrayListCompleteBinaryTree.sibling(Position<E> v)
Returns the sibling of v. |
|
void |
NodePositionList.swapElements(Position<E> a,
Position<E> b)
Swap the elements of two give positions; O(1) time |
|
void |
NodePositionList.swapElements(Position<E> a,
Position<E> b)
Swap the elements of two give positions; O(1) time |
|
void |
LinkedTree.swapElements(Position<E> v,
Position<E> w)
Swap the elements at two nodes |
|
void |
LinkedTree.swapElements(Position<E> v,
Position<E> w)
Swap the elements at two nodes |
|
void |
LinkedBinaryTree.swapElements(Position<E> v,
Position<E> w)
Swap the elements at two nodes |
|
void |
LinkedBinaryTree.swapElements(Position<E> v,
Position<E> w)
Swap the elements at two nodes |
|
void |
ArrayListCompleteBinaryTree.swapElements(Position<E> v,
Position<E> w)
Swaps the elements at two nodes. |
|
void |
ArrayListCompleteBinaryTree.swapElements(Position<E> v,
Position<E> w)
Swaps the elements at two nodes. |
Method parameters in net.datastructures with type arguments of type Position | |
---|---|
java.lang.Iterable<Position> |
FindPathDFS.finalResult(java.lang.Iterable<Position> r)
|
java.lang.Iterable<Position> |
FindCycleDFS.finalResult(java.lang.Iterable<Position> r)
|
void |
TreePosition.setChildren(PositionList<Position<E>> c)
Sets the right child of this position |
void |
TreeNode.setChildren(PositionList<Position<E>> c)
Sets the right child of this position |
Constructor parameters in net.datastructures with type arguments of type Position | |
---|---|
TreeNode(E element,
TreePosition<E> parent,
PositionList<Position<E>> children)
Main constructor |
|
|||||||||
PREV NEXT | FRAMES NO FRAMES |