Data Structures and Algorithms

Language: Python

insert-shift-Array

Challenge02

Write a function called insertShiftArray which takes in an array and a value to be added. Without utilizing any of the built-in methods available to your language, return an array with the new value added at the middle index.

Whiteboard Process

WhiteBoard

Approach & Efficiency

I use the if statement to determine the length of list the position we I need to add this interger in the same list, I keep it simple as possible to make the Big O for both time complaxty and data space not execed O(N).