Data Structures and Algorithms-Module-1-part2
Data Structures and Algorithms-Module-1-part2
and Algorithms
Dr. Nimmy K
Assistant Professor
Department of Computer Science and Engineering
Amrita Vishwa Vidyapeetham, Amritapuri
Arrays
• An array is a collection of similar type of items stored at contiguous
memory locations.
• In C++, a dynamic array can be created using new keyword and can be
deleted it by using delete keyword.
• int *a = new int(n);
• The allocated memory must be deleted using the delete[] operator.
Output
• Write the above program in OOP.
Output: