Teaching and learning computer science sorting algorithms with mobile devices: A case study

  • Published on

  • View

  • Download

Embed Size (px)


  • Teaching and LearningComputer Science SortingAlgorithms With MobileDevices: A Case StudyIVICA BOTICKI,1 ANTE BARISIC,1 SERGIO MARTIN,2 NEVEN DRLJEVIC1

    1Faculty of Electrical Engineering and Computing, Department of Applied Computing, University of Zagreb, Zagreb,


    2Electrical and Computer Engineering Department, UNED (Spanish University for Distance Education), Madrid, Spain

    Received 3 December 2011; accepted 20 February 2012

    ABSTRACT: In this article, we present a semester-long study on using smartphone devices in computingengineering education. We developed Sortko, an Android-based smartphone application for learning sorting

    algorithms, an important undergraduate computer science topic. The application consists of four main compo-

    nentsthe module for interactive sorting, the scaffolding module, the motivational module, and the graphical

    user interface module, each with a distinct role of helping students in learning sorting algorithms. Our re-

    search methodology included data collection with administered two surveys, collected exam results and

    recorded application usage data. Analysis of the collected data shows our approach is an effective way of

    learning sorting algorithms. 2012 Wiley Periodicals, Inc. Comput Appl Eng Educ; View this article online atwileyonlinelibrary.com/journal/cae; DOI 10.1002/cae.21561

    Keywords: mobile learning; engineering education; sorting algorithms


    This study examines educational benets of smartphone devices

    in higher education. In our approach students use Android [1]

    devices as a support in the process of learning sorting algo-

    rithms. Sorting, or putting series of elements in appropriate or-

    der, is an important computer science topic and presents an old

    and well-dened computer science problem. Mastering sorting

    algorithms is especially important for future software engineers

    regardless of the specic domain they work in.

    The growing popularity of smartphone devices can be

    clearly observed in everyday student life. Although they are

    mostly used for fun and informal ways of learning (e.g., access

    to Wikipedia, YouTube, etc.), scientic studies have shown

    the educational value of these devices. Based on an informal

    observation of our students interest in learning with smart-

    phone devices and by taking into account behaviorism and so-

    cialconstructivist theory of learning, we are suggesting a

    design of a smartphone application for learning sorting algo-

    rithms which, amongst others, includes a scaffolding module

    designed to assist students while performing sorting and a moti-

    vational module to additionally motivate students in using the


    Normally, students learn sorting by using a paper and pen-

    cil while simultaneously watching sorting algorithm program

    code. This tiring and ineffective procedure often results in dif-

    ferent kinds of errors such as students learning their own ver-

    sion of a sorting algorithm which does not match the real one

    (the sequence of steps while sorting elements is not adequate).

    We believe that technology can restructure this troublesome and

    ineffective process of learning thereby improving students

    knowledge of sorting algorithms. To verify our assumptions we

    are exploring these research questions:

    The students who used the application achieve betteracademic results than the students who did not use the

    application. The scaffolding module is able to assist students in theprocess of sorting.

    The motivational module motivates students on furtherapplication use.

    These research questions will be explored by analyzing

    results of standard exams, usage logs, and specially designed

    Correspondence to I. Boticki (ivica.boticki@fer.hr).

    2012 Wiley Periodicals, Inc.


  • questionnaires querying our students perception on usage and

    usefulness of the Sortko application and the approach in


    Learning and Playing With Mobile Devices

    An early research conducted in England as early as in 2005 had

    shown that more than 95% of students possess at least one mo-

    bile device [2], which opens up a space for their use in the

    process of educating young people. As for the effectiveness of

    the approach, another study presents a learning trail in which

    students were equipped with 100 Palm Pads stating that 90% of

    teachers had a positive attitude regarding the impact of this

    type of technology on students and on their apprehension of

    learning content [3,4].

    Apart from mobile learning [5,6], game-based learning

    examines the process of studying which is catalyzed and stimu-

    lated with the elements that are considered to be the standard

    parts of games (i.e., awards, collecting points, reaching higher

    levels, and achieving high scores in computer games). These

    motivate players to be involved in the game more thus enhanc-

    ing and accelerating their learning process through repeated

    game play [7].

    The crucial part of such approaches is the united goal of

    the game and of the learning process [8,9]. Once that is

    achieved, learning becomes entertainment and students get mo-

    tivated to learn at home and to take true interest in the course

    contents making the educational process more efcient and

    self-regulated [10]. What is more, by employing new pedago-

    gies which integrate learning with game play, teaching becomes

    more fun as well.

    A Paper and Pencil Approach to Learning SortingAlgorithms

    The topic of learning sorting algorithms is a part of the Algo-

    rithms and Data Structures course at the Faculty of Electrical

    Engineering and Computing, University of Zagreb, Croatia and

    has so far been taught in a paper-and-pencil fashion. Typically,

    various types of sorting algorithms (such as the Bubble sort

    algorithm which bubbles out the greatest number in each

    algorithm pass) [11,12] are visualized by drawing a series of

    algorithm passes, where each pass is drawn as an array of num-

    bers on the blackboard or a sheet of paper. After each algorithm

    pass, a new sequence of numbers is written down again

    (Fig. 1). As a consequence, during exams, students knowledge

    of sorting algorithms is tested in the same way.

    This repetitive and cumbersome way of learning often

    results in errors (i.e., a wrong sequence of algorithm steps is

    learned) and distracts students from actually understanding the

    algorithm big picture. Another problem that arises from this

    type of learning is that there is no easy way a student can check

    the accuracy of her proposed sorting algorithm passes. What is

    more, students sometimes get a correct (sorted) sequence even

    when a wrong set of algorithm steps is applied. For example,

    while applying Quick sort algorithm and identifying the pivotal

    element, a student can decide not to follow the step-to-step ap-

    proach of the algorithm and just position all smaller numbers

    on the left-hand side of the pivotal element and all greater num-

    bers on the right-hand side of the pivotal element. Although

    conceptually correct and with a correct nal solution, this way

    of sorting does not indicate whether the student actually knows

    the precise sequence of steps of the Quick sort algorithm and

    hence is graded with lower marks.

    The Use of Animations in Learning Sorting Algorithms

    The use of animation materials as learning resources has been

    advocated by many researchers [13] and there are a number of

    studies dealing with overcoming the typical difculties in learn-

    ing sorting algorithms with the use of animations [14,15]. Thus,

    many authors [1619] have provided animated resources to

    their students in order to enhance the concepts acquisition.

    Sutinen [20] introduced a Web-based tool, Jeliot, providing

    simple animations helping students in learning and understand-

    ing algorithms and data structures. Kordaki [21] performed a

    pilot where secondary school students used a web-based appli-

    cation helping them in understanding different sorting algo-

    rithms during in-class learning.

    An algorithm animation helps students in the visualization

    of a specic sorting algorithm but does not allow them to try

    out sorting on their own [22]. For example, www.sorting-algo-

    rithms.com web page [23] with a parallel animation of several

    sorting algorithms on the same unsorted number sequence.

    With this simulation several sorting algorithm behaviors can be

    observed on a randomly generated, almost sorted, reversed or a

    sequence with repeated numbers. Figure 2 shows the Sort Ani-

    mation web page which, in addition to the sorting algorithm

    operation animation, allows a parallel view of the programming

    code being executed during a specic animation step. The

    application also shows temporary algorithm variables and pro-

    vides users with a possibility of adjusting the sorting sequence


    In general, animations help viewers track patterns and ob-

    serve relationships, which is claimed to improve learning [24].

    However, some researchers challenge this stating that the use of

    PC-based animations for algorithm visualization does not nec-

    essarily lead to better concepts acquisition than with static dia-

    grams, especially in the case of students needing to make

    Figure 1 Traditional visual representation of the Quick sort sorting

    algorithm operation while sorting an array of numbers. [Color

    gure can be viewed in the online issue, which is available at



  • predictions of the coming animation sequence [13,15,25,26]

    and even suggest that animations distract students. Building on

    the rich amount of knowledge in learning with the help of ani-

    mations we propose a design in which instructional agency

    shifts toward the students side. By allowing students to explore

    the rich space of both incorrect and correct solutions while sort-

    ing, we aim to utilize technology capabilities to provide them

    with scaffolds in an experience-driven learning approach.


    Sortko System in Use

    The smartphone mobile learning application Sortko, designed

    as a part of this study, provides students with a graphical user

    interface with an option of choosing a sorting algorithm (e.g.,

    bubble sort, shell sort, quick sort, insertion sort, etc.) and gener-

    ates a random sequence of numbers to be sorted by applying a

    sequence of specic interaction gestures. During the sorting

    process, the system informs students about their success in per-

    forming so-called switches (element exchanges) and pro-

    vides them with textual help messages facilitating further

    progress. For each game a student gets rewarded with points

    that are then summarized on a joint public list.

    The graphical user interface consists of three main views:

    initial view, sorting view, and the result view, all made in hori-

    zontal mode to maximize display space and usage ergonomics

    (left-hand side of Fig. 3a).

    The sorting view contains a sequence of randomly gener-

    ated numbers (Fig. 3a, callout 1). While students sort by apply-

    ing gestures (Table 1), the system displays contextual textual

    help messages (Fig. 3a, callout 3). After each step (pass) of a

    sorting process, the textual help message changes therefore

    directing students toward the next required action. The current-

    ly used algorithm is shown to users as well (Fig. 3a, callout 4)

    indirectly determining the number of points a student will be

    assigned according to the predened formula (details of the mo-

    tivational module are described in the Motivational Module


    The Sortko application contains an auxiliary visual ele-

    ment positioned separately from the sorting array (Fig. 3a,

    callout 2). It is used to hold a variable with a temporarily

    element value stored until certain algorithm condition gets


    After sorting has completed, the results are sent to the

    server side and the complete ranking list is shown to the sorter

    (Fig. 3b).

    Sortko Application Model

    Sortko System Architecture. Sortko application is built for An-

    droid operating system which includes a set of programming

    libraries corresponding to the elementary Java programming

    language library [1]. Every Android application runs in its own

    process, with its own instance of the Dalvik virtual machine

    (VM). Dalvik [27] is a purpose-built VM designed specically

    for Android taking into account inherent mobile device limita-

    tions such as short battery life and processing power. Sortko

    application is created using Eclipse integrated development

    tools (IDE) equipped with the Android Development Tools

    plugin (ADT plugin) which allows for an easy setup of Android

    projects, application UIs and for the Android Framework API

    component reuse [28].

    The Sortko system is based on the clientserver architec-

    ture model and is divided into the following components: data

    access layer, the domain model, web component, service com-

    ponent, and the smartphone client application (Fig. 4). The

    server side of the system consists of a database, data access

    layer, web services, and a web site. The web part resides on the

    data access layer and can be accessed via desktop computers

    and mobile devices.

    The client part of the system is developed as an Android

    smartphone application and consists of the following modules

    (Fig. 5):

    The Interactive sorting module; The Scaffolding module providing help messages;

    Figure 2 Sort Animation web page with a parallel view of a sorting

    animation and the appropriate algorithm execution (http://www.cs.oswego.

    edu/mohammad/classes/csc241/samples/sort/Sort2-E.html). [Color gurecan be viewed in the online issue, which is available at wileyonlinelibrary.


    Figure 3 Graphical user interface of the Sortko Android smartphone application: (a) sorting view and (b) results

    view. [Color gure can be viewed in the online issue, which is available at wileyonlinelibrary.com.]


  • The Motivational module for awarding students; The User interface module.

    Graphical User Interface Module. The Interactive sorting

    module veries whether sorting steps provided by a student are

    valid for a given sorting algorithm. The Scaffolding module

    helps students in solving typical dilemmas in the sorting pro-

    cess and displays help messages after an error in sorting has

    been identied. It directs users toward choosing the right sort-

    ing solution by illustrating the logic behind a sorting problem,

    which is crucial in understanding sorting algorithms. The Moti-

    vational module tracks the successfulness of sorting according

    to different parameters (speed, accuracy, etc.) and awards points

    to users accordingly. The summary points and ranks are pre-

    sented in form of a web page accessible to all students.

    The client side application architecture follows the Model-

    View-ViewModel pattern [29]. It consists of a view, which col-

    lects user input and forwards it to the viewmodel and which

    actively pulls the data from the viewmodel by using the data

    binding technique. This pattern facilitates desirable software de-

    velopment techniques such as the separation of concerns

    (decoupling), unit testing, and test driven development. View-

    model encompasses all the benets of the patterns such as Mod-



View more >