Beginners Program Web Page Builders and Verifiers Martha J. Kosa Tennessee Technological University Box 5101 Cookeville, TN 38505 +l (931) 372-3579 mjkosa@tntech.edu Tim Bemers-Lee started the now ubiquitous Web phenomenon in 199 1. Students enjoy using Web browsers and often build their own Web pages. To ensure consistent appearance when viewed in different browsers, they may send their pages to a validation site, to verify standard HTML usage. These validators are parsers, which help to compile student programs. Our main focus is on the data structures course, using a traditional high-level programming language, and our students write programs which verify existing Web pages or generate sets of new Web pages as outputs. The outputs then become inputs to another program, i.e., a browser. Hyperlinks connect the output files. Verifying and generating Web pages are realistic uses of data structures. The Web can then serve as a unifying course theme. A well-chosen theme can maintain student interest, because the students can see practical uses for course topics and connections among seemingly unrelated areas. In our data structures class, we cover the usual stacks, queues, lists, binary search trees, and multiway B-trees. We discuss and compare alternative implementations. We may ask the students to implement new data structures. We now describe assignments that show applications of standard data structures to the Web. The students use stacks to translate between formatted text, representing arbitrarily nested ordered and/or unordered lists, and HTML code. Thus, they simulate parts of a browser and an HTML-aware word processor. The students can use queues to store the items in the lists for additional processing. They can use general lists for rearranging the items. This demonstrates possible interactions between data structures because a stack can store information about queues or general lists. The binary tree is the students first nonlinear data structure. They study the traditional preorder, inorder, and postorder traversals, and learn how to build binary search trees, which usually have faster search times than unordered Permission to make digital or hard copies of alI or part of this work for pelSON3l Or classroom use IS granted without fee provided that copies are not made or distributed for profit or commercfal advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish. to post on servers or to redistribute to lists, requires prior specific perm~sswx~ and/or a lee. ITiCSE 99 6/99 Cracow, Poland 0 1999 ACM l-581 13.087.2/99/0005...$5.00 structures. The students can then complete a program to construct a set of formatted Web pages corresponding to an input file. The students build a binary search (or AVL) tree to help in constructing the set. This assignment illustrates the power of recursion because a small recursive function can generate many pages. Student-generated pictures can easily be incorporated. The students study n-ary trees next, and can then complete a program to produce a set of Web pages corresponding to an indented input file. The students build an nary tree to help in constructing the set of pages, requiring the implementation and use of a new data structure. They practice with hierarchies, such as course catalogs, and can again appreciate recursion. Here we describe more ideas for assignments related to sorting, trees, graphs, and hashing. When students visit Web pages, the pages get hits . System log tiles keep statistics on the number of hits. Sorting is used to rank a site s pages according to their numbers of hits. The students can write a program to read a log file and produce a Web page containing the ranking in graphical form. Using trees, the students can produce an index for a set of Web pages, given a starting page. If a given page has links, the files corresponding to those links are processed. The World-Wide Web can be viewed as a graph, where the directed edges are the hyperlinks between Web pages. The students can build a minimum spanning tree for a set of Web pages. The students can compute the shortest path from one page to another. They can perform depth-fist and breadth-first traversals for a set of pages to ensure that all are visited systematically. A hash table can be used to construct a basic search engine. Students need to understand the World Wide Web and traditional concepts from data structures. We presented some progr amming assignments, which use the Web to reinforce course concepts. In the assignments, students generate Web pages and/or verify their correctness. A browser can help with debugging.
/lp/association-for-computing-machinery/beginners-program-web-page-builders-and-verifiers-hSJgrN0KtV