Go language provides a ring package that implements operations on circular lists. To access the functions of the ring package you need to import the ring package in your program with the help of the import keyword.
|func New||This method is used to create a ring of the n elements.|
|func (*Ring) Do||This method is used to call function f on each element of the ring in forward order.|
|func (*Ring) Len||This method is used to computes the number of elements in ring r.|
|func (*Ring) Link||This method is used to connects ring r with ring s such that r.|
|func (*Ring) Move||This method is used to moves n % r.Len() elements backward (n < 0) or forward (n >= 0) in the ring and returns that ring element.|
|func (*Ring) Next||This method is used to returns the next ring element.|
|func (*Ring) Prev||This method is used to returns the previous ring element.|
|func (*Ring) Unlink||This method is used to removes n % r.Len() elements from the ring given r, starting at r.Next().|
GFG GFG GFG GoLang GoLang GoLang
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.