Project2 - Progamming assignment 2 – linked lists due zip-file – Thursday October 5th at 10am hardcopy – Thursday October 5th in the

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Progamming assignment 2 – linked lists due zip-file – Thursday, October 5th at 10am hardcopy – Thursday, October 5th in the beggining of the class . In this assignment you’ll be dealing with a list of integers. The assignment should give additional practice with pointers and dynamical memory allocation. The goal is to implement several functions that manipulate nodes in a linked list. This functions include the traditional like inserting, removing, searching, as well as several function relevant to the data structures we’ll be dealing with – scalar product, addition, transpose, and multiplication. There are two types (though similar) of nodes we’ll be using. One is ElementNode struct ElementNode { int data; int pos; struct ElementNode *next; }; and RowNode struct RowNode { int pos; struct ElementNode *elements; struct RowNode *next; }; both are used to create singly linked lists of corresponding nodes. The data part of the ElementNode is an integer and its position. This may be used to represent a very long vector of numbers most of which are 0’s. Example vector (0 , , , 1 , 2 , , , 0) is a vector with 1 at position 3 and 2 at position 5 (counting from 0). Which looks like (1,3)->(2,4) , where first number in the pair is the value and second is its position. This way we save storage space. This type of vector is usually known as sparse vector . List representation has only one drawback – it doesn’t remember the length of the original vector, e.g. both (0has only one drawback – it doesn’t remember the length of the original vector, e....
View Full Document

This lab report was uploaded on 04/18/2008 for the course CS 225 taught by Professor Volper during the Fall '06 term at DigiPen Institute of Technology.

Page1 / 3

Project2 - Progamming assignment 2 – linked lists due zip-file – Thursday October 5th at 10am hardcopy – Thursday October 5th in the

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online