Increasing the Engagement Level in Algorithms and Data Structures Course by Driving Algorithm Visualizations

,


Introduction
Data structures and algorithms, the subject of our interest within the paper, is one of fundamental subjects taught within the bachelor study program at our department. Since the subject is positioned in the second year of study, students are supposed to have the basic knowledge and some practical skills in programming [12]. The goal of the subject is to further enhance this skills and to provide the students with fundamental knowledge on data structures, methods for designing algorithms and to asses their efficiency. As the area of algorithms and data structures is more general and abstract, it is also more complicated to learn for many students [5]. One of widely adopted approaches to help with this situation is based on using algorithm visualizations within the subjects covering the area [8,6]. Also within our subject, except the conventional ways of teaching (using pseudocodes of algorithms or diagrams), we also use algorithm visualizations for couple of years [17,16]. Although the results achieved by using visualizations are promising [19,20], we further try to improve the educational process in order to make it more attractive and efficient.
If we want to write a correct program for solving a given problem, we need to have pretty clear idea on the algorithm solving the problem. But we also need some practical skills to be able to implement the algorithm in a particular pro-gramming language. So if one of this two basic elements is missing it would be very challenging task, so we can give up, or it will take too long to write the required program. While the first one seems to be absolutely necessary, as without knowing the particular algorithm we will not be able to create its implementation, it does not automatically imply, that a student knowing the algorithm will be able to create the corresponding program. So our hypothesis is, that there will be some part of students, which will be able to apply an algorithm to concrete problem in a visual way, but will not be able to create its corresponding program implementation within the reasonable time limit.
In experiments described further within the paper we want to contribute to this idea by comparing the results of solving simple problems by students just in visual way in one case and by programming the solution in another one. We think it is very useful to utilize algorithm visualizations in order to help students to understand the basic principles of algorithms operation. But according to our experiences, we also believe there is still some gap between understanding the basic principles of particular algorithm and the ability to express it clearly enough in a given programming language. By the experiments we wanted to obtain some empirical results in order to support or to invalidate our informal experiences in this respect. After evaluating the results of experiments we provide some of our ideas how the quality of the understanding of the given topic as well as the ability to implement particular algorithms could be improved jointly.
The rest of the paper is organized as follows. In section 2 we provide a short description on selection of some interesting and influential works on the topic of algorithm visualization and its effectiveness. Section 3 gives an overview of the algorithm visualization systems we developed to support the teaching process in the field of algorithms and data structures. Experiments we conducted are described in section 4 and the results of experiments are evaluated and analyzed in section 5 of the paper. Section 6 proposes a new approach, aiming at increasing the engagement level, supported by the prototype of new study supporting system. Section 7 concludes the paper and provides some ideas for further development.

Related work
There are many tools for algorithm visualizations available presently, which would indicate that algorithm visualizations are widely used in a field of algorithm and data structures education. But, as the results from the recent research in the filed indicate, the important part of effectiveness of algorithm visualization is how students are engaged in a learning activity. Authors of a meta-study [7] conclude, that studies in which students only viewed visualizations, usually did not indicate significant learning advantages over students using conventional learning materials. This can be perceived in a way, that the mere presence of visualizations does not guarantee that students will better understand algorithms. The results of this research also suggest that the most successful educational applications of algorithm visualizations are those in which the visualization is used as a vehicle for engaging students into the process of learning. So the form of the learning activity in which visualization technology is used is more important than the style of visualizations used.
One of modern approaches is based on learning through playing educational games [3,4]. It is believed that using educational games can provide a wide range of benefits (like increased effectiveness, interest and motivation), but those are questionable or at least not rigorously established [11]. In the paper [5] authors present an educational game intended to help students in understanding the stack data structure on conceptual as well as practical level. The Stack Game was developed in three parts, corresponding to learning objectives (understanding the concept of stack, application of stacks, stack implementation), bound together by a meaningful storyline.
An interesting exercise support system, based on combining exercise tasks with automatic evaluation and integrated algorithm animation is described in [14]. The system is based on the established ANIMAL system, since it supports the ad-hoc generation of animation based on data provided by a user. So the creation of new exercise sheets based on existing sheets by the means of modifying the input parameters is supported by the system. The correct answer does not have to be given directly, since it can be determined by the system automatically, based on provided evaluation scripts.
While the above mentioned approaches are interesting, the approach described in this work for increasing students' engagement and motivation is slightly different and it is based on the idea that they would participate on creating visualizations not just using them. The approach, together with the prototype of associated supporting tool, will be described in greater details later in this paper.
Very interesting in this respect is the engagement taxonomy [10], which defines five levels of interaction [8] between a student and an algorithm visualization: Several hypotheses are proposed in [10], which can be interpreted in a way, that the higher level or the more forms of engagement are used, the more efficient the learning becomes. Within our currently available tools (like Algomaster or VizAlgo, described briefly in the following section) first three levels of interaction from the engagement taxonomy are easily accessible for students. Mastering the fourth level (constructing visualizations) however, is bit more complicated, since it requires some knowledge about the structure of the application and its plugin modules. There has been some attempts to simplify the process of creating plugins for Algomaster platform [2], but the solution created has still limited area of usability.
As the approach presented later in this work is based on the idea of involving students deeper into the process of creating particular visualizations, it can be considered to provide the fourth level of interaction within the engagement taxonomy. Hence we hope it could help to increase the learning efficiency by providing the higher level of interaction, as well as to develop practical programming skills by implementing the algorithm under consideration.

Algorithm visualization tools
Within our subject we use algorithm visualizations as an education supporting tools for several years. We started with visualizations available from different authors. But, while it was a quick and simple solution, we encountered the limitations of various kinds time to time, so we started developing our platforms for visualizing algorithms and data structures. Platforms were developed in order to fulfill our specific needs regarding the selection of algorithms, naming conventions or the ability to adapt the visualizations whenever we decided. The platforms are only briefly described here, to provide a reader with basic context, since one of them (Algomaster) was also involved in experiments described in the next section. For more information, additional references are provided as well. The first of the platforms was named VizAlgo [16] and it was developed with emphasis on two main goals: extensibility and portability. The first of the goals is reflected within the structure of the application, which consists of two cooperating parts -the core module and the set of relatively independent plugin modules. The core module is intended to provide the support for displaying and controlling the algorithm execution, while plugin modules are responsible for visualizations of particular algorithms. Choosing the Java development platform was connected with the second of the goals mentioned above. The platform is still in development and over the years not only the set of available visualizations was changing, but also the core functionalities and user interface [1] evolved ( Figure 1).

Figure 1: VizAlgo platform
According to experiences gained with the VizAlgo, the second of the platforms, Algomaster [18], also has the plugin-based architecture, but it was intended to provide some more advanced features. The features include functionality for algorithm stepping in both directions [13], call stack visualization for recursive algorithms and a special mode for practical student testing in a visual way. In contrast to the VizAlgo, the Algomaster is based on .NET framework development and execution platform [9]. Later on, the platform was extended significantly [2] in order to provide the support for visualization of complex algorithms with the ability of changing input data during the visualization. Examples of visualizations using the new features are operations on B-tree, 2-3 tree or AVL tree (Figure 2).
In addition to the ability to define input data dynamically, extensions were also oriented towards a real-time student testing and support for simplified development of plugins for the platform. In order to simplify the creation of Algomaster plugins, a separate application named AlgoCreator (Figure 3) was developed.
The application uses a pattern for generating plugins of particular algorithm class, e.g. pattern for comparisonbased sorting algorithms. A pattern consists of text tem- plates for source code generation and an interpreter for interpreting user defined model. In short, a process of creating a plugin module can be described as follows: a user can select one of available patterns, provide basic algorithmrelated information and the algorithm pseudocode, define the behavior of the algorithm and initiate library generation. The process is described in deeper detail in [2].

Experiments
As it was yet mentioned within introductory part of the paper, the main motivation behind the accomplished experiments was the comparison of the ability of students to solve algorithmic problems in two distinct ways. One of them was based on visual "simulation" of given algorithm operation, using one of our visualization tools, described in section 3. The another one consisted of programming the particular algorithm in given programming language. Experiments considered in this work were conducted with students of four study groups (G 1 -G 4 ) and they were focused on two basic areas. The first area was oriented on traversing trees using different strategies (T ) and the second one on simple comparison-based sorting algorithms (S).
Thus assignments of the particular area consisted of two  Figure 4) and programming the particular algorithm in C programming language (P ) in the another one. This way we got the four combinations (two areas and two ways of solving a problem from the given area -T P , T V , SP and SV ) for each of four study groups (G 1 -G 4 ).
In the area of tree traversing, three basic traversing strategies were used (in-order, pre-order and post-order). In the area of sorting, simple sorting algorithms (like Insert sort and Bubble sort) were used. Within the following four tables (Table 1, Table 2, Table 3, and Table 4  Experiments described within this section were conducted in Fall 2017. 82 students were considered on experiments in total, of which 72 were males and 10 were females. Since all the activities were not necessarily conducted on a single class, not all students were necessarily present on all activities. Such situation can be distinguished in particular table by the presence of "-" character within the Results column. This fact can be perceived as a slight disadvantage, but it is generally hard to influence the presence of students on classes. And since it was registered only in few individual cases from all considered students, we believe it was not affecting the results significantly.

Analysis of the results of experiments
Within this section we provide a sketch of approach for calculating some of the resulting values, summarize the obtained results and formulate some comments on them. For calculating the average scores (mean) of the first group (G 1 ) of students in particular experiments (T P , T V , SP , SV ), the following formulas (1 -4) were used. The average score (G 1 Av T P ) achieved by the study group (G 1 ) in the experiment T P is given by the formula (1). Within the formula, G 1 T S T P represents the total score achieved by the group G 1 in the T P experiment and G 1 N S T P the number of students participating in the experiment. The mean values (G 1 Av T V , G 1 Av SP , G 1 Av SV ) for remaining experiments (T V , SP , SV ) of the study group G 1 were calculated analogically.

Experiment Results
Similarly, the mean values were calculated for remaining groups (G 2 -G 4 ), based on the data presented in tables Table 2, Table 3, and Table 4. Variance and standard deviation values for all experiments were calculated as well and the overall results are available in the table  As we can observe from the graph of average scores ( Figure 5) achieved by students in particular activities, the scores achieved in visual tasks are usually significantly higher than the scores achieved in corresponding programming tasks. The only differences are T P /T V relation for the group G 3 and SP /SV relation for the group G 2 . Also in these cases the scores achieved by solving problems in visual way are higher, but maybe not so significantly. When we further average the results obtained in particular experiments, better results in visual tasks become clearly visible ( Figure 6). These results practically support our informal experiences and the hypothesis expressed within the introductory part of the paper. The results can be also interpreted in a way, that algorithm visualizations provide the solid potential we would like to build upon and examine the new ways of utilizing them in the filed of algorithms and data structures education.
6 Proposal of the new approach and study supporting system In order to cope with the situation and stimulate further students' algorithmic and programming skills, while taking advantage of algorithm visualizations, we propose a new teaching approach supported by the prototype of new study supporting system. As it was mentioned before, the teaching approach is based on the idea that students would participate on creating simple visualizations, and this way interact with algorithm visualization on a higher level of the engagement taxonomy. The role of the proposed system is to provide the environment, that allows students to control the pre-arranged visualizations from their code by using simple programming constructs. The approach, together with the system are intended to be used in conjunction with other teaching methods, not to replace them. The prototype of the system with a working name DSAV (Figure 7) combines algorithm visualizations with programming tasks and so increases the engagement level and supports active learning.
As a proof of concept, we implemented the support for several (Bubble sort, Selection sort, Insertion sort, Quick sort, Heap sort, Merge sort) sorting algorithms [15] and algorithms for traversing binary trees ( Figure 8) using various strategies (Inorder, Preorder, Postorder and Levelorder). We would like to enhance the system in the future, and perspective areas for such enhancements would be visualizations of operations on lists, trees, or graphs. Figure 7: The working prototype of DSAV system Technically, the system essentially consists of two parts: the main part, managing the user interface and visualization, and a separate thread implementing the algorithms to be visualized. There is a simple API consisting of several supporting operations which can be used appropriately by a programmer implementing a particular algorithm. The basic operation available is (RedrawAndWait(int millis)) telling the system to update the visualization according to current values in a data structure shared by both parts and wait for a specified amount of time. In case of sorting algorithms we provide several simple API calls for rendering some elements of sorted array in different color. They can be useful in cases we want to put special emphasis on particular element (elements) of the sorted sequence (Figure 7). Some of them are given in the following list: -CSortClrSetColorRW(int index, int millis) As some of operations tend to be used often together, we also provide special calls for performing combined operations (e.g. CSortClrSetColorRW(index, millis) combines CSortClrSetColor(index) for rendering specified element in different color and RedrawAndWait(millis)). The reason for introducing such combined calls is to leave the code of particular algorithm closer to its original form. Figure 9 provides an example of using one of the operations within a simple sorting algorithm. Analogically, there is a set of simple supporting API calls for visualization of tree traversing algorithms. Some of them are provided in the following list: An example of implementation of simple traversing algorithm is given in Figure 10.
Debugging outputs for particular algorithm can be printed using console output, if needed. The DSAV is a Win32 application, written in C/C++ programming language, since students mainly use this language in exercises within our subject presently.

Conclusion
Within the paper we described our experiments based on solving problems from given areas by students in two different ways. The first way was purely visual, accomplished Figure 10: A simple traversing algorithm implementation within the DSAV system by using the Algomaster platform and the second way was based on programming a particular algorithm using C programming language.
The results acquired are presented and analyzed. We found that the scores achieved in visual tasks are usually significantly higher than the scores achieved in corresponding programming tasks. This correlates with our previous informal experiences and supports the validity of the hypothesis expressed within the introductory part of the paper.
The solution is proposed based on the idea of involving students into the process of creating algorithm visualizations. By the proposed solution we would like to help students not only to understand the basic principles of the particular algorithm in a convenient visual way, but also to stimulate their ability to implement it in particular programming language. Based on our experiences, confirmed by the results of accomplished experiments we believe, we should develop both of the skills in order to better prepare our students for their future professional career.
It would be interesting to further develop the proposed approach and the supporting system and study the contributions of the approach. Except the additional sorting algorithms, perspective areas for further extension would include visualizations of lists, trees, graphs or hash tables. We believe, that if system is enhanced properly and utilized in a right way, it would contribute to the quality of education in the subject. However, the further research is required in order to evaluate the benefits and efficiency of the proposed solution.