DataStructures-and-Algorithms

Code Challenge

Insert and shift an array in middle at index

Specifications

Feature Tasks

Example

Input Output
[2,4,6,-8], 5 [2,4,5,6,-8]
[42,8,15,23,42], 16 [42,8,15,16,23,42]

Stretch Goal

Write a second function that removes an element from the middle index and shifts other elements in the array to fill the new gap.

Documentation: Challenge README.md

# Insert to Middle of an Array
<!-- Description of the challenge -->

## Whiteboard Process
<!-- Embedded whiteboard image -->

## Approach & Efficiency
<!-- What approach did you take? Discuss Why. What is the Big O space/time for this approach? -->

Submission Instructions

  1. Capture an image of your completed whiteboard, matching the example whiteboard layout.
    1. Copy your image into your challenge directory in your repo.
    2. Give the image file the same name as the branch you are working on.
    3. Embed the image in your Challenge README file.
  2. Create a pull request from your branch to the main branch. Use the description field to describe the work accomplished.
  3. Submit your completed work:
    1. Copy the link to your open pull request and paste it into the assignment submission field.
    2. Leave a description of how long this assignment took you in the comments box.
    3. Add any additional comments to your grader about your process or any difficulties you may have had with the assignment.
  4. Merge your branch into main, and delete your branch (don’t worry, the PR link will still work).

Rubrics

Whiteboard

Points Reasoning
3 Whiteboard exercise completed, recommended process followed, and code appears correct
2 Whiteboard exercise completed, and recommended process followed
1 Whiteboard exercise is not complete, or workflow does not follow recommended structure/syntax
0 Whiteboard exercise is significantly incomplete or not present

Readme

Points Reasoning
2 Readme meets all requirements, and the top-level readme of repository properly links to challenge
0 Readme not present in repo, incorrectly linked, or does not meet the specified requirements listed in assignment