J. Appl. Environ. Biol. Sci., 4(7S)22-32, 2014
© 2014, TextRoad Publication
ISSN: 2090-4274
Journal of Applied Environmental
and Biological Sciences
www.textroad.com
* Corresponding Author: Muhammad Shoaib Farooq, Department of Computer Science, University of Management
and Technology, Lahore, Pakistan. {Shoaib.farooq, aqsa.ali, adnan.abid}@umt.edu.pk}
What Should Be Taught about Arrays in CS2?
Muhammad Shoaib Farooq
1,3
, Shakeel Ahmad
2
, Sher Afzal Khan
3
, Aqsa Ali
1
, Adnan Abid
1
1
Department of Computer Science, University of Management and Technology, Lahore, Pakistan
2
Faculty of computing and information technology in Rabigh, King Abdul Aziz University
Jeddah, Saudi Arabia
3
Department of Computer Science, Abdul Wali Khan University, Mardan, Pakistan
Received: September 1, 2014
Accepted: November 13, 2014
ABSTRACT
In this article we have presented a thorough discussion on an important topic, the array which is taught in the
fundamental courses in computer programming. To this end, we have presented a taxonomy of arrays based on
the following four main topics: i) Memory representations; ii) Mapping Functions; iii) Subscript type; and iv)
Abstract data types. We also suggest a flow of teaching these topics to the students. We believe that this effort
will be useful for the instructors to plan their courses, and will be a good source of learning in general.
KEYWORDS: Array implementation, teach array, arrays mapping, teaching array, abstract data type,
teach array CS1, CS2
1 INTRODUCTION
The array is a collection of consecutive elements of the same data type 12345[19]. It is a basic data
structure which is introduced to the students in CS1 course, where the idea is to impart the major concepts
pertaining to this topic to the students of CS1. The importance of this data structure can be highlighted by
the fact that it is used to solve many problems in computer science. Therefore, strong concepts of arrays
should be taught by instructors in CS1, whereas detailed implementation and advanced concepts related to
the topic should be covered in the CS2 course. The array is a data structure in which a mapping from one
finite set (Array indices) to another finite set (array locations) 12345. Every element of the array can be
accessed by its index. For example an array of 5 integer variables 10, 20, 30, 40, 50, with indexes 0 through
4, as shown in Figure 1.
Index 0 1 2 3 4
Data 10 20 30 40 50
Figure. 2. Mapping of integer variables onto the indexes of array
Traditionally, concepts of array are introduced in the computer science undergraduate program curricula
in the first course related to the computer programming, generally known as, CS1 6. At this stage basic
functionality of arrays is introduced to the students such as array declaration, array initialization, getting the
contents of the array from console, access any location of an array, assigning some value to an index of the
array. The most common types of problems solved in CS1 course are: searching an element in the array, sort
the data in an array, sum, and average of the contents of an array etc. The major focus of the instructor is on
problem solving through arrays, but technical issues of arrays are not covered in CS1 due to time constraint,
course outline and course learning outcomes. Although, these contents give the student a general idea about
the data structure and its usage, yet, they are not enough for students to grasp deeper technical concepts of
arrays in a comprehensive manner. Therefore, this topic is usually carried forward in CS2 course, and more
relevant and advanced concepts related to arrays are recommended to be covered in the CS2 course 6.
In this research, we present a taxonomy of arrays as shown in the Figure 2, based on four major
perspectives, including: i) Memory representations; ii) Mapping Functions; iii) Subscript type; and iv)
Abstract data types. We have further explained these high level topics into specialized sub-topics so as to
make it convenient for the course instructor to define her course outline while adding the topics related to
22