Deque
- 1 The append() method of deque class in Python The append() adds an element to the right side of the deque object. As an element is appended to the right side of a deque which is already full and is of fixed-lengt an element is removed from the left. 19 Mar 2017
- 2 appendleft() method of deque class in Python appendleft() adds an element to the left side of a deque object. When fixed size deques are involved when adding an element on the left removes an element on the right 19 Mar 2017
- 3 clear() method of deque class in Python The clear() method of deque class in Python removes all the elements of a deque object. Number of elements of the deque object after calling clear is zero. 19 Mar 2017
- 4 The copy() method of deque class in Python The copy() method of deque class returns a new deque object with shallow copies of the elements.That is the deque object itself is a new object but the contents are copied from the original deque 18 Mar 2017
- 5 The count() method of deque class The count method of deque class counts the number of times an element is present in a python deque instance and returns the count value. 18 Mar 2017
- 6 extend() method in Python The extend() method in python adds more number of elements to the right side of an existing deque object from an iterable 19 Mar 2017
- 7 extendleft() method in Python extendleft() adds elements to the left side of an already existing python object. 19 Mar 2017
- 8 The index() method of deque class in Python The index() method finds the position of an element in a deque object. If start index and stop index are specified, search is restricted between them. 19 Mar 2017
- 9 insert() method of deque class in Python The insert() method of Python deque class inserts an element specified by the index parameter into a deque instance. An IndexError is raised if the deque is of fixed size. 19 Mar 2017
- 10 The deque in Python The deque class is a double ended queue. Elements can be added to and removed from either side of a deque object. This way deque acts as a queue as well as a stack. 18 Mar 2017
- 11 The pop() method of deque class The pop() method of deque class removes the last element of a deque object and returns the value. Calling pop() on an empty deque instance raises an IndexError. 20 Mar 2017
- 12 The popleft() method of deque class The popleft() method removes an element from the left side of a Python deque instance. If the deque is empty, popleft() will raise an IndexError. 20 Mar 2017
- 13 The remove() method of deque class in python collections module The remove() methods removes the first occurence of a value specified by the parameter value. If the value is not found remove() method raises an IndexError. 20 Mar 2017
- 14 The reverse() method of deque class in Python The reverse() method reverses the sequence of elements of a deque object. It returns None. 20 Mar 2017
- 15 The rotate() method of deque class in Python The rotate() method rotates the sequence of elements in the deque object the number of times specified by the parameter n in positive or negative directions. 20 Mar 2017