Lab 5: Array, String

Problem Set 5.0: Array

Design a class and some methods for following tasks:

  1. Declare an integer array of size 100.

  2. Initialize the array with 10 random values.

  3. Define a method to Update the Nth index with a value.

  4. Define a method to Insert a value at the Nth index.

  5. Define a method to Delete the Nth index value.

  6. Define a method to find the summation of all the elements of the array.

  7. Define a method to find the average of all the elements of the array. Use the summation function you already defined.

Problem Set 5.1: Array (One Dimensional Array)

  • Searching

    • Element (Value) of an Index

    • Element Exist or not, or, Index of an Element (Value) [Linear Search, Binary Search]

    • Maximum, Minimum, Second Maximum, Second Minimum Element (Value) from the Array

  • Simulation for Update, Insert and Delete Operations in a One Dimensional Array

  • Updating (Valid Update Index = 0 to Array_Size-1)

    • Update by Index

      • Update at an Index

      • Update before an Index

      • Update after an Index

      • Update at the Beginning (Update at Index 0)

      • Update at the End (Update at Index Array_Size)

    • Update By Element (Value)

      • Update For Single instance of an Element

        • Update an Element

        • Update before an Element

        • Update after an Element

      • Update For Multiple instances of an Element

        • Update first/last/all Element

        • Update before/after the first Element

        • Update before/after the last Element

        • Update before/after all Elements

  • Insertion (Valid Insertion Index = 0 to Array_Size, Check Array Overflow (Insert in a Full Array))

    • Insert by Index

      • Insert at an Index

      • Insert before an Index

      • Insert after an Index

      • Insert at the Beginning (Insert at Index 0)

      • Insert at the End (Insert at Index Current Size)

    • Insert By Element (Value)

      • Insert For Single instance of an Element

        • Insert before an Element

        • Insert after an Element

      • Insert For Multiple instances of an Element

        • Insert before/after the first Element

        • Insert before/after the last Element

        • Insert before/after all Elements

  • Deletion (Valid Deletion Index = 0 to Array_Size-1, Check Array Underflow (Delete from an Empty Array))

    • Delete by Index

      • Delete at an Index

      • Delete before an Index

      • Delete after an Index

      • Delete at the Beginning (Insert at Index 0)

      • Delete at the End (Insert at Index Current Size - 1)

    • Delete by Element (Value)

      • Delete For Single instance of an Element

        • Delete an Element

        • Delete before an Element

        • Delete after an Element

      • For Multiple instances of an Element

        • Delete first/last/all Element

        • Delete before/after the first Element

        • Delete before/after the last Element

        • Delete before/after all Elements

    • Delete All Element (Clear)

  • Calculate the Summation, Average, and Standard Deviation of all elements of the given array.

  • Copying one Array to another Array, Merging two Array, Reverse an Array, Compare two Array.

  • Function: Do all the following Array Operations using Function

    • Pass an Array to a Function

    • Return an Array from a Function

    • Searching

    • Updating

    • Insertion

    • Deletion

    • Calculation

Problem Set 5.2: Array (Two Dimensional Array)

  • Operations on Two Dimensional Array

    • Summation, Subtraction, and Multiplication of two N×N Matrix

  • Pass and Return Two Dimensional Array to and form a Function

Last updated