0% found this document useful (0 votes)
7 views3 pages

Lab04 Linked Linear Data Structures

Linked Linear Data Structures on Data structure and algorithm

Uploaded by

Titania Aurels
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views3 pages

Lab04 Linked Linear Data Structures

Linked Linear Data Structures on Data structure and algorithm

Uploaded by

Titania Aurels
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Data Structures

Lab05 - Linked Linear Data Structures

1 Implement Line Editor


• Implement a simple text editor, where user can add, delete and replace text lines. In addition,
text lines can be written to a file or list of text lines can be populated from a text file.

• An object-oriented solution with multiple classes.

1. Node : Data structure to hold the line text


2. SinglyLinkedList : store the linked nodes of text lines.
3. LineEditor : provide functions for adding, deleting and replacing text lines. .

1
2 Implement Sparse Polynomial
• Sparse polynomials have many missing terms. In other words, coefficients for many terms are
zero. Linked list data structures are better for these kind of polynomials. Implement the sparse
polynomial using list data structure

• An object-oriented solution with multiple classes.

1. Node2 : node data structure for doubly linked list


2. DoublyLinkedList : store the linked nodes
3. SparsePoly : Provide functions reading, storing and processing of polynomials
4. Term : data structure for the basic unit of any polynomial i.e. term .
3 Using circular linked list to solve Josephus Problem
• There are n people (n is an even number) standing in a circle waiting to be executed.

• The counting out begins at some point in the circle and proceeds around the circle in a fixed
direction.

• In each step, a certain number of people m (m is an odd number) are skipped and the next
person is executed.

• The elimination proceeds around the circle (which is becoming smaller and smaller as the exe-
cuted people are removed), until only the last person remains, who is given freedom.

• An object-oriented solution with multiple classes.

1. Node : node data structure for Circularly linked list


2. CircularlyLinkedList : store the linked nodes
3. JosephusProblem : Provide functions for solving the Josephus Problem

You might also like