0% found this document useful (0 votes)
16 views1 page

CSE220 Lab Quiz 02 SetA

Uploaded by

ohidul.hossain
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)
16 views1 page

CSE220 Lab Quiz 02 SetA

Uploaded by

ohidul.hossain
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/ 1

CSE220: Data Structure (Lab)

Summer 2024 Marks


A Obtained:
Lab Quiz - 02
Duration: 30 Minutes

Name: ID: Section:


Question 1 [20 Points]
You are playing a survival game where right now you are standing in front of a maze, containing
a lot of dangerous animals. You have to find a path to get out of the maze and also you have to
find a treasure box. For solving the maze few things you need to consider:
● Horizontally and vertically the maze should be the same in size.
● There are two starting points. From those points you need to move upward diagonally.
● If the length of the maze is odd then the treasure box lies in the median position,
otherwise it lies in the upward middle position.
Your task is to write a function finding_path which takes the maze as input and return a 2 D matrix
containing the path sequence. Your program should also print the treasure box number.

🐍 🐋 🕷 🐍 🕷
🐋 🕷 🐍 🐋 💰 💰 🐍

🐍 🕷 💰 🐋 🕷 🐍 🐋

🕷 🐍 🕷 🕷 🐍

🐋 🕷 🐍 [start] [start]

[start] [start]

Input Output

[38461 The treasure is in box no: 7


72193
[ 1 1 7 9 1
90758 6 4 7 2 3 ]
21340
14286]

[9431 The treasure is in either box no: 8 or 5


1582
[ 6 3 8 1
4376 4 7 5 9 ]
6154]

[2465 "Wrong maze! There is no way to escape."


1973]

You might also like