CS502 Assignment 1 ...

Share:
Notifications
Clear all

# CS502 Assignment 1 Spring 2021

(@khizarshahal)
New Member
Joined: 2 months ago
Posts: 1
Topic starter

Assignment No. 01
SEMESTER Spring 2021

CS502- Fundamentals of Algorithms

Total Marks: 20

Due Date: 19-05-2021

Instructions

Please read the following instructions carefully before solving & submitting assignment:

It should be clear that your assignment will not get any credit if:

·       The assignment is submitted after due date.

·       The submitted assignment does not open or file corrupt.

·       The assignment is full or partially copied from (other student or ditto copy from handouts or internet).

·       Student ID is not mentioned in the assignment File or name of file is other than student ID.

·       The assignment is not submitted in .doc or .docx format.

## Uploading instructions

Your submission must include:

• Assignment should be in .doc or .docx format.
• Save your assignment with your ID (e.g. bx180200786.doc).
• Assignment submission through email is NOT acceptable.

## Objective

The objective of this assignment is

·       To give basic knowledge and understanding of Algorithms.

·       To be able to design simple algorithms.

·       To be able to understand and calculate the complexity of algorithms.

Note:

Your answer must follow the below given specifications.

·        Font style: “Times New Roman”

·        Font color: “Black”

·        Font size: “12”

·        Bold for heading only.

·        Font in Italic is not allowed at all.

·        No formatting or bullets are allowed to use.

·       Your answer should be precise and to the point, avoid irrelevant detail.

Lectures Covered: This assignment covers Lecture # 01 - 08

Deadline

Your assignment must be uploaded/submitted on or before 19-05-2021.

Question No 01:                                                                                              (Marks:  10)

Suppose that one of the largest commercial bank branch in UAE has recently experienced a significant distress due to covid 19.  A huge No. of account holders withdraws the payment from the bank. Now manager want to check the total number of accounts those have less than 1000\$.

You are required perform the following task:

1. Write only Pseudocode to check the total number of accounts, who have less than 1000\$ using array list.
2. After writing Pseudocode calculate the worst-case time complexity T(n).

Question No 02:                                                                                            (Marks:  10)

A prime number is a number that can only be divided by itself and 1. Using the following code, we can check whether the number is prime or not. Your task is to find the time complexity of the following code with respect to worst case.

int arr[5], j, x , y, z;

for(x=0; x<5; x++)

{

cout<<"Enter the no."<<endl;

cin>>arr[x];

}

for(x=0;x<5;x++)

{

y=0;

for(j=2; j<arr[x];j++)

{

z=arr[x]%j;

if(z==0)

{

y=1;

break;

}

}

if(y==0)

cout<<arr[x]<<endl;

}

}

For any query about the assignment, contact at [email protected]

GOOD LUCK

admin liked
Topic Tags
(@zero)
Eminent Member
Joined: 5 months ago
Posts: 46

(@axxad-paraxx)
Estimable Member
Joined: 2 years ago
Posts: 168

(@admin)
Admin
Joined: 3 years ago
Posts: 6411

CS502 Assignment 1 Spring 2021

CS502 solution idea:

Download attachment for CS502 assignment 1 Spring 2021 solution file.

Students kindly share assignment files in relevant subject timely for discussion/solution.
or directly share with us " Click here"
QueryVU Telegram Groups subject wise Join Now
QueryVU WhatsApp groups subject wise Join Now

Share: