0% found this document useful (0 votes)
34 views2 pages

Lab Misc

This document outlines 4 tasks involving common data structures - arrays, linked lists, stacks, and queues. Each task describes a scenario and lists 5 tasks to design and implement the necessary operations for that data structure. The array task involves a task management app, linked lists task a music playlist app, stacks task a text editor undo history, and queues task a print job management system.

Uploaded by

Muskan Shaikh
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)
34 views2 pages

Lab Misc

This document outlines 4 tasks involving common data structures - arrays, linked lists, stacks, and queues. Each task describes a scenario and lists 5 tasks to design and implement the necessary operations for that data structure. The array task involves a task management app, linked lists task a music playlist app, stacks task a text editor undo history, and queues task a print job management system.

Uploaded by

Muskan Shaikh
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/ 2

Lab - Miscellaneous Tasks

Task 1: Arrays

Scenario:
You are building a simple task management applica4on that stores tasks in an array. Each
task has a 4tle, descrip4on, and status (e.g., "To Do," "In Progress," "Done"). Design and
implement the array opera4ons needed for this applica4on.

Tasks:
1. Create a structure or class represen4ng a task with 4tle, descrip4on, and status fields.
2. Implement a func4on to add a new task to the array.
3. Write a func4on to display all tasks in the array.
4. Develop a func4on to mark a task as "Done" by upda4ng its status.
5. Implement a func4on to delete a task from the array by its 4tle.

Task 2: Linked Lists

Scenario:
You are working on a music playlist applica4on where each song is represented by a node in
a linked list. Each node contains the song's 4tle, ar4st, and dura4on. Design and implement
the linked list opera4ons required for managing the playlist.

Tasks:
1. Create a class or structure for a song node with 4tle, ar4st, and dura4on fields.
2. Implement a func4on to add a new song to the playlist.
3. Write a func4on to display the en4re playlist.
4. Develop a func4on to remove a song from the playlist by its 4tle.
5. Implement a func4on to find the total dura4on of the playlist.

Task 3: Stacks

Scenario:
You are developing a text editor that needs to keep track of the history of user ac4ons (e.g.,
typing, dele4ng, undoing). Design and implement a stack-based system to manage the user
ac4ons.

Tasks:
1. Create a stack to store user ac4ons (e.g., strings represen4ng ac4ons).
2. Implement a func4on to push a new user ac4on onto the stack.
3. Write a func4on to pop the last user ac4on from the stack (undo opera4on).
4. Develop a func4on to display the en4re history of user ac4ons.
5. Implement a func4on to clear the en4re history stack.

Task 4: Queues
Lab - Miscellaneous Tasks

Scenario:
You are building a print job management system for a printer. Print jobs are represented as
nodes in a queue. Each node contains informa4on about the document to be printed. Design
and implement the queue opera4ons needed for the print job management.

Tasks:
1. Create a class or structure for a print job node with document informa4on.
2. Implement a func4on to enqueue a new print job.
3. Write a func4on to dequeue the next print job in the queue.
4. Develop a func4on to display the details of all print jobs in the queue.
5. Implement a func4on to clear all print jobs from the queue.

You might also like