Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

rotating circular queue in python

def circularArrayRotation(a, k, queries):
    from collections import deque 
    items = deque(a) 
    items.rotate(k)
    ret_list = []
    for q in queries:
        #print(items[q])
        ret_list.append(items[q])
    return ret_list
Source by www.codementor.io #
 
PREVIOUS NEXT
Tagged: #rotating #circular #queue #python
ADD COMMENT
Topic
Name
9+4 =