CS240 Lecture Notes - Null Pointer, Linked List, Memory Address

41 views1 pages

Document Summary

Problem: write an assembly language program that determines the last element in a non-empty, non-circular linked list using a recursive procedure. The linked list is represented by an array as follows: Any two consecutive array elements a[i] and a[i + 1] form a node of the linked list. For the node starting at index i of the array, a[i] is the list element and a[i + 1] is a pointer giving the array index (not the memory address) of the next node. The rst node"s element and next node pointer are in a[0] and a[1], respectively. A null pointer (signifying the end of the list) is represented by -1. For example, the linked list 6 23 1 10 could be represented as follows: However, the list nodes need not be nicely ordered like this, and can even overlap . For both of these example input arrays, the program should store 10 in and halt.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents