0% found this document useful (0 votes)
12 views

Assignment 01 - FA24

Uploaded by

noumanzahi7676
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)
12 views

Assignment 01 - FA24

Uploaded by

noumanzahi7676
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

COMSATS University, Islamabad

Islamabad Campus
Department of Computer Science

Read before Attempt


Assignment No. 1: STATIC AND DYNAMIC LIST
Course code and Title: CSC211, Data Structure
Instructor: Tanveer Ahmed
Assigned Date: September 17,2024 Due Date: October 1,2024
Total Marks: --
CLO-1: Employ linear data structures to solve computing problems.
Instructions:
1. This is an individual assignment. You will submit your work individually through your logins
on MS Team
2. Try to get the concepts, consolidate your concepts and ideas from these questions
3. You should concern recommended books for clarify your concepts as handouts are not
sufficient.
4. Try to make solution by yourself and protect your work from other students.
If I found the solution files of some students are same, then I will reward zero
marks to all those students.
5. Deadline for this assignment is October 1,2024. This deadline will not be extended.

FA2024 Page 1
Question # 1 (Static List)
Let L be a static list of n distinct elements. Write pseudocode(algorithm) that find all elements in given list
which have at-least two greater elements than themselves
Example:
Input: L [5] = {2, 8, 7, 1, 5};
Output: 2,1,5
Question # 2(Single Linked List)
Write pseudocode(algorithm) that prints alternate nodes of the given Linked List, first from head to end, and
then from end to head. If Linked List has even number of nodes, then skips the last node.
Question # 3(Single Linked List)
Write an algorithm that takes a simply linked list as input argument and modifies the list by moving the last
element to the front of the list.
Question # 4 (Circular Linked List)
Let sum1 and sum2 be the sum of even and odd nodes in a given circular linked list. Write an algorithm that
compute sum1 and sum2 and replace first and last node of given circular linked list with sum1 and sum2
respectively.
For example: Following is given input circular linked list:

7 11 9 3 4 8

sum1 = 22 sum2 = 20

22 11 9 3 4 20

Question # 5 (Double Linked List)


Let k be a given integer value. Write an algorithm that search two nodes in double linked list whose sum is
equal to k.
Question # 6 (Double Circular Linked List)
Write an algorithm that delete duplicate node from given circular doubly linked list.
Question # 7
You are developing a software application for a real estate company to manage residential listings. Currently,
the listing information is stored on 3x5 cards in the firm's office, each card containing details such as:
Card # 1
Owner Name: Tanveer Ahmed
House Address: House #321, Islamabad
Price: Rs. 190000/=
Size and Details: 1800 sq. Feet, 3 bedrooms

FA2024 Page 2
As a software developer you decided to implement a linked list to manage these listings. Provide the data
structure design for the linked list and pseudocode to handle the following requirements:
1. Add a House Listing: Write a function to add a new house listing to the linked list. Each node in the
list should store the information from the 3x5 card.
2. Delete a House Listing: Write a function to delete a house listing from the linked list based on the
owner’s name.
3. Print Information by Owner’s Name: Write a function to search for and print the details of a house
listing given the owner's name.
4. Print Homeowners Alphabetically: Implement a function to print a list of all homeowners in
alphabetical order based on their names.
Question # 8
a) Draw a diagram of how List of List data structures might look both static and Linked List.
b) Write algorithms for insertion, deletion and display operations for above data structures.

FA2024 Page 3

You might also like