LogIn
I don't have account.

SortedSet Methods in C#

DevSniper
160 Views

Methods

  1. Add :- public bool Add (T item);
  2. Contains :- public bool Contains (T item);
    returns true if element present in the set otherwise false

    Time Complexity :- O(log n)

  3. Clear :- public void Clear ();
    It will remove all elements from the set.

    Time Complexity :- O(n)

  4. CopyTo(T[]) :- public void CopyTo (T[] array);

    Copy all source set elements into provided 1-D array

  5. CopyTo (T[] , int) :- public void CopyTo (T[] array, int arrayIndex);

    Copy source set elements into provided 1-D array from index, arrayIndex passed by params (zero-based index)

  6. CopyTo (T[] , int , int) :- public void CopyTo (T[] array, int arrayIndex, int count);

    Copy specific number (passed in params) of source set elements into provided 1-D array from index, arrayIndex passed by params (zero-based index)

  7. CreateSetComparer() :- public static System.Collections.Generic.IEqualityComparer<System.Collections.Generic.SortedSet<T>> CreateSetComparer ();
  8. CreateSetComparer(IEqualityComparer<T>) :-
    public static System.Collections.Generic.IEqualityComparer<System.Collections.Generic.SortedSet<T>> CreateSetComparer (System.Collections.Generic.IEqualityComparer<T>? memberEqualityComparer);
  9. Equals (Object) :- public virtual bool Equals (object? obj);
  10. ExceptWith(IEnumerable<T>) :- public void ExceptWith (System.Collections.Generic.IEnumerable<T> other);

    Remove all elements form the source set SortedSet<T> that are present in specified collection IEnumerable<T>.

  11. GetEnumerator() :- public System.Collections.Generic.SortedSet<T>.Enumerator GetEnumerator ();

    Proides an enumerator that iterates through the SortedSet<T>.

  12. GetHashCode() :- public virtual int GetHashCode ();

    Returns a hashcode of current object.

  13. GetType() :- public Type GetType ();

    Returns the type of current instance.

  14. IntersectWith(IEnumerable<T>) :- public void IntersectWith (System.Collections.Generic.IEnumerable<T> other);

    i will modify current SortedSet such a way so that it will contains only elements that are present in set and provided collection both.

  15. IsProperSubsetOf(IEnumerable<T>) :- public bool IsProperSubsetOf (System.Collections.Generic.IEnumerable<T> other);
  16. IsProperSupersetOf(IEnumerable<T>) :- public bool IsProperSupersetOf (System.Collections.Generic.IEnumerable<T> other);
  17. IsSubsetOf(IEnumerable<T>) :- public bool IsSubsetOf (System.Collections.Generic.IEnumerable<T> other);
  18. IsSupersetOf(IEnumerable<T>) :- public bool IsSupersetOf (System.Collections.Generic.IEnumerable<T> other);
  19. MemberwiseClone() :- protected object MemberwiseClone ();

    it will creates and return a shallow copy of the current Object.

  20. OnDeserialization(Object) :-protected virtual void OnDeserialization (object? sender);
  21. Overlaps(IEnumerable<T>) :- public bool Overlaps (System.Collections.Generic.IEnumerable<T> other);

    Returns true if the SortedSet<T> object and other provided collection object IEnumerable<T> share at least one common element otherwise false

  22. Remove(T) :- public bool Remove (T item);

    Remove the specified elements (pass in params) from the SortedSet.

  23. RemoveWhere(Predicate<T>) :- public int RemoveWhere (Predicate<T> match);

    Removes all elements from the current SortedSet<T> that satisfy the conditions defined by the given predicate and return the total number of elements removed from the SortedSet<T>.

  24. SetEquals(IEnumerable<T>) :- public bool SetEquals (System.Collections.Generic.IEnumerable<T> other);

    Returns true if current SortedSet<T> and given collection IEnumerable<T> contains the same elements otherwise false.

  25. SymmetricExceptWith(IEnumerable<T>) :- public void SymmetricExceptWith (System.Collections.Generic.IEnumerable<T> other);

    it will modifies the current SortedSet<T> object so that it contains only elements that are present either in the current object or in the specified collection, but not both.

  26. ToString() :- public virtual string? ToString ();

    It will return a string that represents the current object.

  27. TryGetValue(T, T)public bool TryGetValue (T equalValue, out T actualValue);
  28. UnionWith(IEnumerable<T>) :- public void UnionWith (System.Collections.Generic.IEnumerable<T> other);

    it will modify current SortedSet<T> object so that it contains all elements that are present either in the current SortedSet<T> object or in the specified collection IEnumerable<T>.

  29. Reverse() :- public System.Collections.Generic.IEnumerable<T> Reverse ();

    It will return an enumerator that iterates over the SortedSet<T> in reverse order.

  30. GetViewBetween(T, T) :- public virtual System.Collections.Generic.SortedSet<T> GetViewBetween (T? lowerValue, T? upperValue);

    It will return a subset view that contains only the values between lowerValue and upperValue range.

  31. GetObjectData(SerializationInfo, StreamingContext) :-
    protected virtual void GetObjectData (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);