• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.


Module 3 - Lists

Page history last edited by Dr. Ron Eaglin 4 years, 6 months ago

Module 3 - Lists


Lists are one of the most fundamental of the data types. Your ability to understand lists as an Abstract Data Type (ADT) and implement lists is key to your understanding of all the more complex data structures. In this module you should first completely review Topic - Basic Data structures which covers lists. Once complete you should be ready to tackle some of the challenging assignments available in this module.





Assignment 1 - In Javascript we are going to create a doubly Linked List. If you need a little primer on creating objects and classes in Javascript see http://www.w3schools.com/js/js_object_definition.asp - if you know your object oriented code this will be relatively straightforward. Your List will be made up of Nodes. Each node will have the following properties;


id - A simple id for the node itself,

content - A value (String)

next - A pointer to the next node in the List (null for the last node).

last - A pointer to the previous node in the List


Your List will have the following properties;

head - Pointer to the first node in the list

Length - Number of nodes in the list


Here is a simple Javascript code that represents the concept using the analogy of a chain and links. It should be a good demonstration for you to use in writing your code.  https://jsfiddle.net/reaglin/q46obht6/


You will make a List consisting of 5 nodes. You will also create a print function for the chain that will print the nodes in order. You will need to create some functions to support this functionality.


If you have questions you MUST post to the bulletin board. All students who are in progress or working on this will be granted extensions if they are asking questions on the BB.



Quizzes (Quiz Submission Instructions )


Quiz 1 - Complete quiz at http://geeksquiz.com/data-structure/linked-list/  


Assignment Grading -  This assignment is fundamental to the knowledge and operation of all the remaining data structures. You must be able to successfully implement your linked list. You must implement a function to the list to add nodes (on the end), and print the final list with all node values. You may use my code as a guideline - but should write this entire project from scratch. No grade will be assigned to this assignment until all functionality is implemented. Both objects coded correctly, implementation of a List print function and a List addNode function. Code to create the list by adding 5 nodes - must all work correctly.


Your making a list - I'm checking it twice.



Previous: Module 2 - Algorithms

Next: Module 4 - Stacks


Comments (0)

You don't have permission to comment on this page.