Quick Index
Description


Before Starting


It will be helpful to do a quick review of a fixed array....

Problem Statement


This challenge project will be about writing algorithms for our first data structure MyArray

The purpose of "MyArray" is to provide the functionality to support common collection behaviors. Our algorithms will provide the logic needed for these behaviors.

Definition of MyArray:


Limitations of "MyArray":


Objectives



Tips


Getting Started



Examples - Tips



Challenge Problem - Tips



Problem Context (Object Universe)



Equality Gotcha


Most of our examples in this chapter use primitives for simplicity, but in reality our structures will contain proper objects like customers, employees, students, ... Thus we need to support objects.

This means we must do the following:


See more info here....

Getting Stumped


I hope we get "stumped" a little bit on some of these! That's how we'll learn. I would guess there would be a grading "curve" (that's a guess). Just do your best and fire questions to all avenues (discussion board, emails instructor/tutors, tutoring sessions, ...). And also step back and re-try an example, or try another if really stumped on one.

Challenge Rules


These rules are driving us towards an object approach. And that basically means one thing: message sends.

Here is the small set of rules for this challenge which apply to the algorithms to be written:


Note -- in rare cases, the challenge write-up may include explicit notes that would override a rule

We may use any of the tasty menu of algorithms (methods) described and listed above in "Object Universe".

Challenge Problems


Here are the problems to complete: Challenge Problems

As mentioned, "MyArray" will be a practical structure. We need to write algorithms that will give the structure its brains.

These public methods need to have algorithms written:


* - indicates a completed algorithm provided for you -- see Examples...

Project Files


Provided Files


Here are the provided files for this challenge: a3-project.zip.

Extract (copy) the "a3-project" directory from the ZIP archive into a working directory of your computer.

The directory "a3-project" will be our "project directory".

Contents of extracted project directory:
Directory PathDescription
a3-projectproject root directory
a3-project\A3Contains your "algorithm files"
a3-project\libNo changes needed
a3-project\modelNo changes needed
a3-project\algo-studioSee "Algorithm Studio" below


Algorithm Studio

An algorithm studio is available for this challenge. It is optional but could help with "proving" (testing) algorithms.

See Algorithm Studio Instructions....

File Management


The files are simple for this challenge. They have already been setup for you (see "Provided Files" above).

Each algorithm has its own corresponding file in the "a3-project/A3" directory.

For example, the algorithm for the method "lastIndexOf" should be put in the file "A3/lastIndexOf.js".

In each file, simply replace the text "//ALGORITHM HERE (Pseudocode)" with your algorithm written in pseudocode per these syntax rules.

About half of the files are already completed. They make up the Examples for this chapter. The completed files will also provide good reference for you to help you get started on your own. You do not need to make any changes on the files that are already completed.

Submitting



References


This listing is a consolidation of the references (links) from above: