उत्परिवर्तनीय संग्रह

extension MutableCollection
extension MutableCollection where Self: BidirectionalCollection
extension MutableCollection where Self: RandomAccessCollection
  • संग्रह के तत्वों को घुमाता है ताकि middle का तत्व पहले समाप्त हो जाए।

    जटिलता

    पर )

    घोषणा

    @discardableResult
    public mutating mutating func rotate(shiftingToStart middle: Index) -> Index

    प्रतिलाभ की मात्रा

    तत्व का नया सूचकांक जो पहले प्री-रोटेशन था।

उपलब्ध है जहां `स्वयं`: `द्विदिशात्मक संग्रह`
  • संग्रह के तत्वों को घुमाता है ताकि middle का तत्व पहले समाप्त हो जाए।

    जटिलता

    पर )

    घोषणा

    @discardableResult
    public mutating mutating func rotate(shiftingToStart middle: Index) -> Index

    प्रतिलाभ की मात्रा

    तत्व का नया सूचकांक जो पहले प्री-रोटेशन था।

उपलब्ध है जहां `स्वयं`: `RandomAccessCollection`
  • संग्रह के तत्वों को घुमाता है ताकि middle का तत्व पहले समाप्त हो जाए।

    जटिलता

    पर )

    घोषणा

    @discardableResult
    public mutating func rotateRandomAccess(
      shiftingToStart middle: Index
    ) -> Index

    प्रतिलाभ की मात्रा

    तत्व का नया सूचकांक जो पहले प्री-रोटेशन था।