Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ARRAY LIST I need help with this . fill in the blanks Thanks //*****************

ID: 3743706 • Letter: A

Question

ARRAY LIST I need help with this . fill in the blanks Thanks //******************************************************************** #ifndef ARRLIST_H #define ARRLIST_H //******************************************************************** template <typename TYPE> class ArrList { private: TYPE* list;//points to dynamically allocated array int capacity;//capacity of array int numValues;//number of items currently in the array bool _resize(); public: ArrList(int c = 5); ~ArrList(); void display() const; ______ insertFront ( ___________________________________ ) ; ______ insertBack ( ___________________________________ ) ; ______ insertAtIndex ( ___________________________________) ; ______ retrieveFront ___________________________________) const; ______ retrieveBack ( ___________________________________) const; ______ retrieveAtIndex ( ___________________________________) const; ______ retrieve ( ___________________________________) const; // find first occurrence of item ______ removeFront ( ___________________________________) ; ______ removeBack ( ___________________________________ ) ; ______ removeAtIndex ( ___________________________________ ) ; ______ remove ( ___________________________________) ; ______ updateFront ( ___________________________________) ; ______ updateBack ( ___________________________________) ; ______ updateAtIndex ( ___________________________________) ; ______ update ( ___________________________________ ) ; ______ getSmallest ( ___________________________________) const; ______ getCapacity () const; ______ getNumValues () const; ______isEmpty ()const; ______ clearList ();// removes all items from list }; #endif //******************************************************************** ARRAY LIST I need help with this . fill in the blanks Thanks //******************************************************************** #ifndef ARRLIST_H #define ARRLIST_H //******************************************************************** template <typename TYPE> class ArrList { private: TYPE* list;//points to dynamically allocated array int capacity;//capacity of array int numValues;//number of items currently in the array bool _resize(); public: ArrList(int c = 5); ~ArrList(); void display() const; ______ insertFront ( ___________________________________ ) ; ______ insertBack ( ___________________________________ ) ; ______ insertAtIndex ( ___________________________________) ; ______ retrieveFront ___________________________________) const; ______ retrieveBack ( ___________________________________) const; ______ retrieveAtIndex ( ___________________________________) const; ______ retrieve ( ___________________________________) const; // find first occurrence of item ______ removeFront ( ___________________________________) ; ______ removeBack ( ___________________________________ ) ; ______ removeAtIndex ( ___________________________________ ) ; ______ remove ( ___________________________________) ; ______ updateFront ( ___________________________________) ; ______ updateBack ( ___________________________________) ; ______ updateAtIndex ( ___________________________________) ; ______ update ( ___________________________________ ) ; ______ getSmallest ( ___________________________________) const; ______ getCapacity () const; ______ getNumValues () const; ______isEmpty ()const; ______ clearList ();// removes all items from list }; #endif //******************************************************************** ARRAY LIST I need help with this . fill in the blanks Thanks //******************************************************************** #ifndef ARRLIST_H #define ARRLIST_H //******************************************************************** template <typename TYPE> class ArrList { private: TYPE* list;//points to dynamically allocated array int capacity;//capacity of array int numValues;//number of items currently in the array bool _resize(); public: ArrList(int c = 5); ~ArrList(); void display() const; ______ insertFront ( ___________________________________ ) ; ______ insertBack ( ___________________________________ ) ; ______ insertAtIndex ( ___________________________________) ; ______ retrieveFront ___________________________________) const; ______ retrieveBack ( ___________________________________) const; ______ retrieveAtIndex ( ___________________________________) const; ______ retrieve ( ___________________________________) const; // find first occurrence of item ______ removeFront ( ___________________________________) ; ______ removeBack ( ___________________________________ ) ; ______ removeAtIndex ( ___________________________________ ) ; ______ remove ( ___________________________________) ; ______ updateFront ( ___________________________________) ; ______ updateBack ( ___________________________________) ; ______ updateAtIndex ( ___________________________________) ; ______ update ( ___________________________________ ) ; ______ getSmallest ( ___________________________________) const; ______ getCapacity () const; ______ getNumValues () const; ______isEmpty ()const; ______ clearList ();// removes all items from list }; #endif //********************************************************************

Explanation / Answer

//********************************************************************

#ifndef ARRLIST_H

#define ARRLIST_H

//********************************************************************

template <typename TYPE>

class ArrList

{

    private:

   

        TYPE* list;//points to dynamically allocated array

        int capacity;//capacity of array

        int numValues;//number of items currently in the array

        bool _resize();

       

    public:

   

        ArrList(int c = 5);

        ~ArrList();

        void display() const;

       

        // x is the element to be inserted

        void insertFront ( TYPE x ) ;

       

        // x is the element to be inserted

        void insertBack ( TYPE x ) ;

       

        // x is the element to be inserted at index index

        void insertAtIndex ( TYPE x, int index );

       

        TYPE retrieveFront() const;

        TYPE retrieveBack() const;

       

        // index is the position of the element which is to be returned

        TYPE retrieveAtIndex (int index) const;

       

        // x is the element to be retrieved

        TYPE retrieve (TYPE x) const;

        // find first occurrence of item

       

        void removeFront () ;

        void removeBack ( ) ;

       

        // index is the position of the element which is to be removed

        void removeAtIndex ( int index ) ;

       

        // x is the element to be removed

        void remove ( TYPE x) ;

       

        // x is the element to be set as new front

        void updateFront ( TYPE x ) ;

       

        // x is the element to be set as new back

        void updateBack ( TYPE x) ;

       

        // x is the element to be set as new elemebt at index index

        void updateAtIndex ( TYPE x, int index ) ;

       

        // old_val o=is to be replaced with new_val

       void update ( TYPE old_val , TYPE new_val ) ;

        TYPE getSmallest () const;

        int getCapacity () const;

        int getNumValues () const;

        bool ()const;

        void clearList ();// removes all items from list

};

#endif

//********************************************************************