Skip to content

T_CodeJam_Algorithms

andrewvk edited this page Mar 24, 2016 · 13 revisions

Algorithms Class

[This is preliminary documentation and is subject to change.]

Miscellaneous algorithms

Inheritance Hierarchy

System.Object
  CodeJam.Algorithms
Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#

public static class Algorithms

VB

<ExtensionAttribute>
Public NotInheritable Class Algorithms

F#

[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type Algorithms =  class end

The Algorithms type exposes the following members.

Methods

 

Name Description
Public methodStatic member EqualRange(TElement)(IList(TElement), TElement) Returns the tuple of [i, j] where i is the smallest index in the range [0, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [0, list.Count - 1] such that list[i] > value or list.Count if no such j exists

Remarks

Comparer.Default is being used for comparison

Public methodStatic member EqualRange(TElement)(IList(TElement), TElement, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [from, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [from, list.Count - 1] such that list[i] > value or list.Count if no such j exists

Remarks

Comparer.Default is being used for comparison

Public methodStatic member EqualRange(TElement, TValue)(IList(TElement), TValue, Func(TElement, TValue, Int32)) Returns the tuple of [i, j] where i is the smallest index in the range [0, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [0, list.Count - 1] such that list[i] > value or list.Count if no such j exists
Public methodStatic member EqualRange(TElement, TValue)(IList(TElement), TValue, Int32, Int32, Func(TElement, TValue, Int32)) Returns the tuple of [i, j] where i is the smallest index in the range [from, to - 1] such that list[i] >= value or "to" if no such i exists j is the smallest index in the range [from, to - 1] such that list[i] > value or "to" if no such j exists
Public methodStatic member LowerBound(TElement)(IList(TElement), TElement) Returns the minimum index i in the range [0, list.Count - 1] such that list[i] >= value or list.Count if no such i exists

Remarks

Comparer.Default is being used for comparison

Public methodStatic member LowerBound(TElement)(IList(TElement), TElement, Int32) Returns the minimum index i in the range [from, list.Count - 1] such that list[i] >= value or list.Count if no such i exists

Remarks

Comparer.Default is being used for comparison

Public methodStatic member LowerBound(TElement, TValue)(IList(TElement), TValue, Func(TElement, TValue, Int32)) Returns the minimum index i in the range [0, list.Count - 1] such that list[i] >= value or list.Count if no such i exists
Public methodStatic member LowerBound(TElement, TValue)(IList(TElement), TValue, Int32, Int32, Func(TElement, TValue, Int32)) Returns the minimum index i in the range [from, to - 1] such that list[i] >= value or "to" if no such i exists
Public methodStatic member Swap(T) Swaps two objects
Public methodStatic member UpperBound(TElement)(IList(TElement), TElement) Returns the minimum index i in the range [0, list.Count - 1] such that list[i] > value or list.Count if no such i exists

Remarks

Comparer.Default is being used for comparison

Public methodStatic member UpperBound(TElement)(IList(TElement), TElement, Int32) Returns the minimum index i in the range [from, list.Count - 1] such that list[i] > value or list.Count if no such i exists

Remarks

Comparer.Default is being used for comparison

Public methodStatic member UpperBound(TElement, TValue)(IList(TElement), TValue, Func(TElement, TValue, Int32)) Returns the minimum index i in the range [0, list.Count - 1] such that list[i] > value or list.Count if no such i exists
Public methodStatic member UpperBound(TElement, TValue)(IList(TElement), TValue, Int32, Int32, Func(TElement, TValue, Int32)) Returns the minimum index i in the range [from, to - 1] such that list[i] > value or "to" if no such i exists
  Back to Top

See Also

Reference

CodeJam Namespace

Clone this wiki locally