CS301 – Data Structures Assignment No. 1 Semester: Fall 2022

Shahzaib Rasool
By -

CS301 Data Structures Assignment No.1 Solution 2022

you can download cs301 assignment file latest 2022 solution for fall 2022 students.

in This file you will get the solution of problem given in LMS assignment section.

Problem Statement:

You are required to make a program using C++ language to implement singly linked list. Your will create a linked list of random numbers and display last asked elements of linked list on the console (command prompt). Following are the detailed requirements.

 

  1. Decide the size of linked list
    1. Generate a random number between 15 to 20 and use it as size of linked list. Every time the program will be executed a different number should be generated.
  2. Fill/create the linked list with random numbers in range 1 to 100.
  3. Display the last few elements of linked list on console.
    1. The number of last few elements will be entered by user.
  4. If user will enter 5 then display last five elements of linked list. If the user will enter 8 then display last eight elements of linked list.

 

Important Instructions:

You need to fulfill the following requirements while solving the assignment task.

1.      Use only user defined classes for Node and List, the use of struct is not allowed.

2.      The structure of Node and List classes should be similar to the structure given below. If you will create extra data members then your marks will be deducted.

3.      User will enter the no. of elements he wants to see, so your application should display entered no. of last elements. 

4.      An animated gif file is attached with assignment file. This animation contains the procedure to select last elements of your choice. Once you have selected the elements of your choice then you can display them easily.






Download .CPP Assignment File Here
Download CS301 Assignment 1 solution 2022

 

Head