Skip to content

T_CodeJam_Algorithms

Andrew Koryavchenko edited this page Jun 17, 2018 · 13 revisions

Algorithms Class

Miscellaneous algorithms

Inheritance Hierarchy

System.Object
  CodeJam.Algorithms
Namespace: CodeJam
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.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(IList(DateTime), DateTime) 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(IList(DateTimeOffset), DateTimeOffset) 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(IList(Double), Double) 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(IList(Single), Single) 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(IList(TimeSpan), TimeSpan) 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(IList(DateTime), DateTime, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such j exists
Public methodStatic member EqualRange(IList(DateTimeOffset), DateTimeOffset, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such j exists
Public methodStatic member EqualRange(IList(Double), Double, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such j exists
Public methodStatic member EqualRange(IList(Single), Single, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such j exists
Public methodStatic member EqualRange(IList(TimeSpan), TimeSpan, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such j exists
Public methodStatic member EqualRange(IList(DateTime), DateTime, Int32, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such j exists
Public methodStatic member EqualRange(IList(DateTimeOffset), DateTimeOffset, Int32, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such j exists
Public methodStatic member EqualRange(IList(Double), Double, Int32, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such j exists
Public methodStatic member EqualRange(IList(Single), Single, Int32, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such j exists
Public methodStatic member EqualRange(IList(TimeSpan), TimeSpan, Int32, Int32) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such j exists
Public methodStatic member EqualRange(TElement, TValue)(IList(TElement), TValue) 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, 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) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, 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, Func(TElement, TValue, Int32)) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists j is the smallest index in the range [startIndex, 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) Returns the tuple of [i, j] where i is the smallest index in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex 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 [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists j is the smallest index in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such j exists
Public methodStatic member LowerBound(IList(DateTime), DateTime) 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(IList(DateTimeOffset), DateTimeOffset) 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(IList(Double), Double) 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(IList(Single), Single) 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(IList(TimeSpan), TimeSpan) 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(IList(DateTime), DateTime, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists
Public methodStatic member LowerBound(IList(DateTimeOffset), DateTimeOffset, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists
Public methodStatic member LowerBound(IList(Double), Double, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists
Public methodStatic member LowerBound(IList(Single), Single, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists
Public methodStatic member LowerBound(IList(TimeSpan), TimeSpan, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] >= value or list.Count if no such i exists
Public methodStatic member LowerBound(IList(DateTime), DateTime, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists
Public methodStatic member LowerBound(IList(DateTimeOffset), DateTimeOffset, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists
Public methodStatic member LowerBound(IList(Double), Double, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists
Public methodStatic member LowerBound(IList(Single), Single, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists
Public methodStatic member LowerBound(IList(TimeSpan), TimeSpan, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists
Public methodStatic member LowerBound(TElement, TValue)(IList(TElement), TValue) 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, 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) Returns the minimum index i in the range [startIndex, 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, Func(TElement, TValue, Int32)) Returns the minimum index i in the range [startIndex, 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) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] >= value or endIndex 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 [startIndex, endIndex - 1] such that list[i] >= value or endIndex if no such i exists
Public methodStatic member Memoize(TArg, TResult)(Func(TArg, TResult), Boolean) Caches function value for specific argument.
Public methodStatic member Memoize(TArg, TResult)(Func(TArg, TResult), LazyThreadSafetyMode) Caches function value for specific argument.
Public methodStatic member Memoize(TArg, TResult)(Func(TArg, TResult), IEqualityComparer(TArg), Boolean) Caches function value for specific argument.
Public methodStatic member Memoize(TArg, TResult)(Func(TArg, TResult), IEqualityComparer(TArg), LazyThreadSafetyMode) Caches function value for specific argument.
Public methodStatic member Memoize(TArg1, TArg2, TResult)(Func(TArg1, TArg2, TResult), Boolean) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TResult)(Func(TArg1, TArg2, TResult), LazyThreadSafetyMode) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TResult)(Func(TArg1, TArg2, TArg3, TResult), Boolean) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TResult)(Func(TArg1, TArg2, TArg3, TResult), LazyThreadSafetyMode) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TResult), Boolean) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TResult), LazyThreadSafetyMode) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TArg5, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TResult), Boolean) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TArg5, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TResult), LazyThreadSafetyMode) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult), Boolean) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult), LazyThreadSafetyMode) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult), Boolean) Caches function value for specific arguments.
Public methodStatic member Memoize(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult)(Func(TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult), LazyThreadSafetyMode) Caches function value for specific arguments.
Public methodStatic member PartitionPoint(T)(IList(T), Predicate(T)) Returns the index i in the range [0, list.Count - 1] such that predicate(list[j]) = true for j < i and predicate(list[k]) = false for k >= i or list.Count if no such i exists

Remarks

The list should be partitioned according to the predicate

Public methodStatic member PartitionPoint(T)(IList(T), Int32, Predicate(T)) Returns the index i in the range [startIndex, list.Count - 1] such that predicate(list[j]) = true for j < i and predicate(list[k]) = false for k >= i or list.Count if no such i exists

Remarks

The list should be partitioned according to the predicate

Public methodStatic member PartitionPoint(T)(IList(T), Int32, Int32, Predicate(T)) Returns the index i in the range [startIndex, endIndex - 1] such that predicate(list[j]) = true for j < i and predicate(list[k]) = false for k >= i or endIndex if no such i exists

Remarks

The list should be partitioned according to the predicate

Public methodStatic member Swap(T) Swaps two objects
Public methodStatic member UpperBound(IList(DateTime), DateTime) 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(IList(DateTimeOffset), DateTimeOffset) 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(IList(Double), Double) 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(IList(Single), Single) 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(IList(TimeSpan), TimeSpan) 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(IList(DateTime), DateTime, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such i exists
Public methodStatic member UpperBound(IList(DateTimeOffset), DateTimeOffset, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such i exists
Public methodStatic member UpperBound(IList(Double), Double, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such i exists
Public methodStatic member UpperBound(IList(Single), Single, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such i exists
Public methodStatic member UpperBound(IList(TimeSpan), TimeSpan, Int32) Returns the minimum index i in the range [startIndex, list.Count - 1] such that list[i] > value or list.Count if no such i exists
Public methodStatic member UpperBound(IList(DateTime), DateTime, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such i exists
Public methodStatic member UpperBound(IList(DateTimeOffset), DateTimeOffset, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such i exists
Public methodStatic member UpperBound(IList(Double), Double, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such i exists
Public methodStatic member UpperBound(IList(Single), Single, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such i exists
Public methodStatic member UpperBound(IList(TimeSpan), TimeSpan, Int32, Int32) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such i exists
Public methodStatic member UpperBound(TElement, TValue)(IList(TElement), TValue) 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, 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) Returns the minimum index i in the range [startIndex, 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, Func(TElement, TValue, Int32)) Returns the minimum index i in the range [startIndex, 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) Returns the minimum index i in the range [startIndex, endIndex - 1] such that list[i] > value or endIndex 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 [startIndex, endIndex - 1] such that list[i] > value or endIndex if no such i exists
  Back to Top

See Also

Reference

CodeJam Namespace

Clone this wiki locally