0% found this document useful (0 votes)
2 views5 pages

Week 2 Module

Uploaded by

rajgahoi01
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)
2 views5 pages

Week 2 Module

Uploaded by

rajgahoi01
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

Week 2 Module:

Date: 17/06/2026

1. Fraud Transaction Detection (Linear Search)

Problem Statement

A bank stores transaction IDs in the order they occur. Since the transactions are not sorted, the
security team needs to check if a suspicious transaction ID exists.

Write a program using Linear Search.

Input Format

• First line contains integer N

• Second line contains N transaction IDs

• Third line contains suspicious transaction ID

Output Format

Print:

Fraud Transaction Found

or

Transaction Not Found

Example

Input

5
1201 1305 1450 1408 1502
1450

Output

Fraud Transaction Found


2. Server Log Search (Binary Search)

Problem Statement

A cloud company stores server log IDs in sorted order. Engineers need to quickly verify if a log ID
exists.

Write a program using Binary Search.

Input Format

• First line contains N

• Second line contains sorted log IDs

• Third line contains target log ID

Output Format

Print:

Log Found

or

Log Not Found

Constraints

• 1 ≤ N ≤ 10^5

Example

Input

7
1001 1005 1010 1015 1020 1030 1040
1015

Output

Log Found
3. Sort Employee Salaries (Bubble Sort)

Problem Statement

A company wants to sort employee salaries in ascending order for payroll analysis.

Write a program using Bubble Sort.

Input Format

• First line contains N

• Second line contains salaries

Output Format

Print sorted salaries.

Example

Input

5
45000 32000 55000 28000 60000

Output

28000 32000 45000 55000 60000


4. Sort Website Response Time (Insertion Sort)

Problem Statement

A web monitoring system records website response times. New data comes continuously and must
be inserted into the correct position.

Write a program using Insertion Sort.

Input Format

• First line contains N

• Second line contains response times

Output Format

Print sorted response times.

Example

Input

5
250 120 320 180 100

Output

100 120 180 250 320


5. Prioritize Bug Reports (Selection Sort)

Problem Statement

A software company assigns priority scores to bug reports. To resolve bugs efficiently, they want to
sort priorities in ascending order.

Write a program using Selection Sort.

Input Format

• First line contains N

• Second line contains priority scores

Output Format

Print sorted priority scores.

Example

Input

5
92815

Output

12589

You might also like