Drawing on Merritt's divide-and-conquer sorting taxonomy [1], we model comparison-based sorting as an abstract class with a template method to perform the sort by relegating the splitting and joining of arrays to its concrete subclasses. Comparison on objects is carried out via an abstract ordering strategy. This reduces code complexity and simplifies the analyses of the various concrete sorting algorithms. Performance measurements and visualizations can be added without modifying any code by utilizing the decorator design pattern. This object-oriented design not only provides the student a concrete way of unifying seemingly disparate sorting algorithms but also help him/her differentiate them at the proper level of abstraction.
Designing a two-person game involves identifying the game model to compute the best moves, the user interface (the "view") to play the game, and the controller to coordinate the model and the view. A crucial task is to represent the algorithms used in their highest abstract forms. This can prove to be a difficult and subtle endeavor. It is made easier however by the use of good object-oriented (OO) design principles to help maintain a high level abstract viewpoint during the design process. The state pattern is used to represent the game board and is coupled with the visitor pattern to provide state-dependent, variant behaviors. The min-max algorithm and its variants are implemented as the strategy pattern, which allows flexible and extensible computational capability. Careful analysis is performed to properly abstract the interactions between the model and the view. The command design pattern is used to provide callback services between the model and the view. Leading students through this design process enables them to learn algorithms and architectures that easily scale to full-sized applications.
In order to build a data structure that is extensible and reusable, it is necessary to decouple the intrinsic and primitive behavior of the structure from the application specific behavior that manipulates it. To illustrate such a construction, this paper proposes a uniform object-oriented structural pattern for recursive data structures, and shows how external algorithms can be added without rewriting any code using the visitor design pattern. By presenting data structures iu this mauner, we can more effectively teach students about recursion, abstraction, design, and good software engineering practices.
In order to build a data structure that is extensible and reusable, it is necessary to decouple the intrinsic and primitive behavior of the structure from the application specific behavior that manipulates it. To illustrate such a construction, this paper proposes a uniform object-oriented structural pattern for recursive data structures, and shows how external algorithms can be added without rewriting any code using the visitor design pattern. By presenting data structures in this manner, we can more effectively teach students about recursion, abstraction, design, and good software engineering practices.
SynopsisDesign patterns provide ways to structure software components into systems that are flexible, extensible, and have a high degree of reusability. The state pattern, the null , object pattern, and the singleton pattern are used to implement common data structures such as lists and trees. These 'patterns help narrow the gap between me abstract views of the data structures and their concrete implementations. The smaller the gap, the higher the level of abstraction.' The more abstract, the'less complex the coding structure. As' a result, algorithms are easier-~ to understand and more manageable. This paper advocates teaching the above design patterns in data structures courses. -.--1._
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.