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

Assignment 01 SP20

This document provides instructions for Assignment 1 on data structures and algorithms. It includes 6 questions on topics like static lists, single linked lists, circular linked lists, and double linked lists. Students are asked to design algorithms to find elements with at least two greater elements in a static list, print alternate nodes of a linked list from both ends, move the last element of a linked list to the front, compute sums of even and odd nodes in a circular linked list and replace the first and last nodes, search for two nodes in a double linked list whose sum is equal to a given integer, and delete duplicate nodes from a circular doubly linked list. Students must submit their individual work by the March 4th deadline.

Uploaded by

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

Assignment 01 SP20

This document provides instructions for Assignment 1 on data structures and algorithms. It includes 6 questions on topics like static lists, single linked lists, circular linked lists, and double linked lists. Students are asked to design algorithms to find elements with at least two greater elements in a static list, print alternate nodes of a linked list from both ends, move the last element of a linked list to the front, compute sums of even and odd nodes in a circular linked list and replace the first and last nodes, search for two nodes in a double linked list whose sum is equal to a given integer, and delete duplicate nodes from a circular doubly linked list. Students must submit their individual work by the March 4th deadline.

Uploaded by

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

COMSATS University, Islamabad

Islamabad Campus
Department of Computer Science

Read before Attempt


Assignment No. 1:
Course code and Title: CSC211, Data Structure and Algorithm
Instructor: Tanveer Ahmed
Assigned Date: February 24, 2020 Due Date: March 4,2020
Total Marks: -- CLO-1:
Instructions:
1. This is an individual assignment. You will submit your work individually through your logins
(course portal)
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 March 4,2020. This deadline will not be extended.

Question # 1 (Static List)


Let L be a static list of n distinct elements. Design an 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)
Design an 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 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:

SP2020 Page 1
7 11 9 3 4 8

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.

a) Draw a diagram of how List of List data structures might look both static and Linked List.
b) Write algorithms/ routines to implement the appropriate operations for of each implementation of
above data structures

SP2020 Page 2

You might also like