Options
All
  • Public
  • Public/Protected
  • All
Menu

This implementation uses depth-first search. The constructor takes time proportional to V + E (in the worst case), where V is the number of vertices and E is the number of edges. Afterwards, the preorder and postorder operations take constant time, and

reverse postorder operation takes take time proportional to V.

Type parameters

  • V

Hierarchy

  • DepthFirstOrderDFS

Implements

Index

Constructors

constructor

Properties

Private marked

marked: StringMap<boolean> = new StringMap<boolean>()

Private postCounter

postCounter: number = 0

Private postorder

postorder: Queue<object> = newQueue<Vertex<V>>()

Private preCounter

preCounter: number = 0

Private preorder

preorder: Queue<object> = newQueue<Vertex<V>>()

Private verticesPostorder

verticesPostorder: StringMap<number> = new StringMap<number>()

Private verticesPreorder

verticesPreorder: StringMap<number> = new StringMap<number>()

Methods

Private dfs

post

postorderNumber

  • postorderNumber(v: Vertex<V>): number

pre

preorderNumber

  • preorderNumber(v: Vertex<V>): number

reversePost

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc