Ghostwriting C#Fitness, C++, Ghostwriting C++, Maze Problem List, Ghostwriting C++ Programming Program Homework


11. Maze problem 1.
Problem description:
Maze solving is a classic problem in experimental psychology. Psychologists take a
mouse large The entrance of the box rushed into the maze. There were many partitions in the maze, which formed many
obstacles . The psychologist placed a piece of cheese at the only exit of the maze to attract mice to find a way in the maze
to reach the exit. The maze is represented by a rectangular matrix of m×n, 0 and 1 represent the path and
obstacle there are 4 forward directions, namely up, down, left and right. Design a program to find a path from the entrance to the exit for an arbitrarily set
maze, or come to the conclusion that there is no path.
2. Implementation requirements: (
1) Design a data structure storage maze; (
2) Implement a stack type with a linked list as a storage structure, and then write a non-recursive
program to . The obtained path is output as a triple (i,j,d), where: (i,j) indicates
a coordinate in the maze, and d indicates the direction to go to the next coordinate.
(3) Write a recursive algorithm to obtain all possible paths in the maze;
(4) Output the maze and its paths in the form of a square matrix.
3. Test data
The test data of the maze is as follows: the upper left corner (1, 1) is the entrance, and the lower right corner (8, 9) is the exit.
1 2 3 4 5 6 7 8
0 0 1 0 0 0 1 0
0 0 1 0 0 0 1 0
0 0 0 0 1 1 0 1
0 1 1 1 0 0 1 0
17 / 43
0 0 0 1 0 0 0 0
0 1 0 0 0 1 0 1
0 1 1 1 1 0 0 1
1 1 0 0 0 1 0 1
1 1 0 0 0 0
0
0 The method of "exhaustive solution" is to start from the entrance and explore in a certain direction
. If you can get through, continue to move forward; otherwise, go back along the original road and continue to explore in another direction
until the exit position. Get a way. If all possible paths are explored and the exit cannot be reached,
the set maze has no path. The maze data can be stored in a two-dimensional array. Usually, the subscript of the entry point
is (1, 1), and the subscript of the exit point is (m, n). For the convenience of handling,
a circle . For any position in the maze, it can be agreed that there are four directions of east, south, west and north.
The backtracking method can be used to solve this problem. Backtracking is a
search method that constantly tries to correct errors in time. Starting from the entrance, explore forward in a certain direction. If you can walk through (not walked), that is
, you can reach somewhere, then you will reach the new point, otherwise, try the next direction; if there is no path in all directions, follow
Return to the previous point on the
foundoriginal , or there is no way to go and return to the entry point.
During the solution process, in order to ensure that the original path can be returned at any position, a LIFO
stack is needed to save the path from the entry to the current position.
The maze can be defined as a two-dimensional array, and each point has 4 tentative directions. For example, the coordinates of the current point
are (x, y), and the coordinates of the 4 adjacent points can be determined according to the adjacent points. obtained from the orientation, the prescribed test
The exploration order is clockwise, and the coordinate increments in these four directions are placed in a structure array move[4].
In the move array, each element consists of two fields: x represents the abscissa increment, y represents Vertical coordinate
increment . This will easily find the coordinates from a point (x, y) to a new point (i, j) in a certain direction v (0≤v≤3)
: i=x+move[v].x; j =y+move[v].y.
18 / 43
12. Ranking of grades
1. Problem description
Suppose there are 4 classes in a certain grade, and each class has 40 students. There are 5 course exams this semester, and each
course is graded on a percentile scale. Assume that each student's grade record includes: student ID, grades of each course, a total of 6
items, of which the student ID is a 12-digit string (refer to the student ID of the classmates), and each student has a unique
student ID. And the grades of these 4 classes are placed in 4 arrays respectively, and the following operation requirements are completed:
⑴ Write a grade generating function, use the random number method, and use the random function to generate the grades of each
course of the students (the grades of each course are is an integer between 0∽100),
generate ; (
2) Write an average grade calculation function, calculate the average grade of each student and save it in the grade
array ;
(3) Use the Hill sort method The grades of the 4 classes are sorted by the average grade of each student in a non-increasing manner
;
(4) The grades of the 4 classes are sorted by the average grade of each student in a non-increasing manner
using . Sorting;
(5) Use the quick sort method to sort the grades of the four classes according to the average grade of each student in a non-increasing manner
;
(6) Use the radix sorting method to sort the grades of the four classes according to the average grade of each student in a non-increasing manner
;
⑸ Design a menu with at least the basic functions required by the above operation.
2. The test data
is determined by the students.
19/43
13. Sports meeting score statistics system
1. Problem description
There are n schools participating in the sports meeting, and the school number is 1...n. The competition is divided into u men's events and w
women's events. Item numbers are 1...u for men and u+1...u+w for women. The top five or top three points for different projects
; the top five points are respectively: 7, 5, 3, 2, 1, and the top three points are: 5, 3,
1; which ones are the top five The first or the top three are set by the students themselves. (u<=20,w<=20)
2. Basic requirements
(1) You can enter the top three or top five scores of each item;
(2) You can count the total score of each school,
(3) You can press the school number , the total score of the school and the total score of the male and female groups are sorted and output;
(4) You can query the situation of a school project by the school number; you can query the
top three .
Regulations: Input data form and range: an integer within 20 (if you do better, you can enter the name of the school and the
name of the sport)
Output form: there are Chinese prompts, and the scores of each school are integers
Interface requirements: there are reasonable prompts, A menu can be set up for each function, and the
relevant .
Storage structure: Students design their own according to the system function requirements, but require the relevant data of the sports meeting
data to be stored in the data file. (The data reading and writing method of the data file and other related content are in the book of C language
programming , please solve it by yourself) Please indicate the storage structure you use in the final submission;
3. The test data
requires the use of 1. All Legal data; 2. Overall illegal data; 3. Partial illegal data. Perform
program testing to ensure program stability. Please indicate the test data and test results in the submitted materials;
20 / 43
14. Parking lot management system
1. Problem Description
Implement a parking lot management system using stacks and queues;
suppose a parking lot is a long and narrow passageway that can park n cars, and there is only one gate for vehicles to enter and
exit. Vehicles are parked from the innermost part of the parking lot to the gate according to the time of arrival at the parking lot (the first vehicle that
arrives first is placed at the innermost part of the parking lot). If the parking lot is full of n cars, the later cars
can only wait on the sidewalk outside the gate of the parking lot. Once a car leaves in the parking lot, the first
car on the sidewalk will enter the parking lot. If a car wants to drive away in the parking lot, the cars that enter the parking lot after it
must exit the parking lot to make way for it.
When each vehicle leaves the parking lot, it is charged according to the length of time it has been in the parking lot. If
a car parked on the sidewalk is about to leave the parking lot before entering the parking lot, it is allowed to leave, no parking fee is charged, and
the order of vehicles waiting on the sidewalk is still maintained.
2. The basic requirement is to
prepare a program to simulate the management of the parking lot. The information of the vehicle includes: car arrival/departure sign,
license plate number, arrival/departure time, etc. Simulation management is performed according to the data sequence read from the terminal. per car
Three data are required, where the vehicle data is: A for arrival, D for departure, and E for the end of the program.
Assuming that the vehicle license plate is an integer data, the entry or departure time is also an integer data. The output information after operating each group of input data
is: if the vehicle arrives, output the
parking ; if the vehicle leaves, output the time the car stayed in the parking lot and the response time. Fees paid (
no charge for time spent on the sidewalk). The stack is implemented in a sequential structure, and the queue is implemented in a linked list.
The parking lot management system mainly realizes the following functions:
(1) According to the time when the vehicle arrives at the parking lot and when the vehicle leaves the parking lot, it charges by time.
(2) The program design can check the location of the vehicle in the parking lot or sidewalk through the license plate number.
(3) When a vehicle leaves the parking lot, the waiting vehicles enter the parking lot and park in sequence. Implement the scheduling function of the
parking lot .
3. Test data
assume n=2 or 3 (you can set test data yourself)
(A, 1, 5)
21 / 43
(A, 2, 10)
(D, 1, 15)
(A, 3, 20)
(A, 4 , 25)
(A, 5, 30) (D,
2, 35)
(D, 4, 40)
(E, 0, 0)
4. To realize the prompt
, another stack needs to be set up to temporarily park the cars that exit from the parking lot in order to make way for the cars that
are about to leave. The input data is ordered by the moment of arrival or departure. Each element in the stack represents
a car and contains two data items: the car's license plate number and the time it entered the parking lot.
http://www.6daixie.com/contents/14/1352.html

The core members of the team mainly include Silicon Valley engineers, BAT front-line engineers, top 5 master and doctoral students in China, and are proficient in German and English! Our main business scope is to do programming assignments, course design and so on.

 

Our field of direction: window programming, numerical algorithm, AI, artificial intelligence, financial statistics, econometric analysis, big data, network programming, WEB programming, communication programming, game programming, multimedia linux, plug-in programming program, API, image processing, embedded/MCU database programming, console process and thread, network security, assembly language hardware Programming software design engineering standards and regulations. The ghostwriting and ghostwriting programming languages ​​or tools include but are not limited to the following:

C/C++/C# ghostwriting

Java ghostwriting

IT ghostwriting

Python ghostwriting

Tutored programming assignments

Matlab ghostwriting

Haskell ghostwriting

Processing ghostwriting

Building a Linux environment

Rust ghostwriting

Data Structure Assginment

MIPS ghostwriting

Machine Learning homework ghostwriting

Oracle/SQL/PostgreSQL/Pig database ghostwriting/doing/coaching

web development, website development, website work

ASP.NET website development

Finance Insurance Statistics Statistics, Regression, Iteration

Prolog ghostwriting

Computer Computational method

 

Because professional, so trustworthy. If necessary, please add QQ: 99515681 or email: [email protected]

WeChat: codinghelp

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325217670&siteId=291194637