Professional Documents
Culture Documents
Tech Time
Problem 1
Tech Time
Problem 2
Tech Time
Problem 3
Deleting First element
● Implement method int pop_front () in the vector class
● It returns the deleted value
● Remove First element from the the Vector
● Assume array is: 4 0 1 2 3
● pop_front()
○ Return value 4
○ New array: 0 1 2 3
Tech Time
Problem 4
Deleting Last element
● Implement method int pop_back () in the vector class
● It returns the deleted value
● Remove last element from the the Vector
● Assume array is: 4 0 1 2 3
● pop_back()
○ Return value 3
○ New array: 4 0 1 2
Tech Time
Problem 5
Deleting Last element
● Implement method int pop_back () in the vector class
● It returns the deleted value
● Remove last element from the the Vector
● Assume array is: 4 0 1 2 3
● pop_back()
○ Return value 3
○ New array: 4 0 1 2
Tech Time
Problem 6
Deleting a position
● Implement method int pop(int idx) in the vector class
● It returns the deleted value
● Remove this element from the array
● Assume array is: 4 0 1 2 3
● pop_back(2)
○ Return value 1
○ New array: 4 0 2 3
Tech Time
Problem 6 : Right rotation
Tech Time
Problem 7: Left rotation
Tech Time