Write stata sequential linear table, linear table data structure homework

Write stata sequential linear table, linear table data structure operation
of job order linear table
1. Problem description:
Based on the dynamic sequential storage structure of the linear table, the algorithms for the following operations are implemented through functions.
2. Implementation requirements: define the functions that implement the following operations (
1) Establishment of the sequence table: input the number of elements n of the established sequence table through the keyboard, and
generate an integer between [100, 100000] by random generation.
⑵ All elements of the output sequence table.
(3) To find the minimum and next-smallest element values ​​in the sequence table, the time complexity of the algorithm is required to be O(n).
The smallest and next-smallest element values ​​are brought back through pointer variables, and the function does not need to return values.
⑷ Delete all elements in the sequence table with values ​​between S and T (the size relationship between S and T is arbitrary), and
the time complexity of the algorithm is required to be O(n). If S and T are unreasonable or the sequence table is empty, then An error message is displayed.
⑸ Delete all elements with repeated values ​​in the sequence table, so that all elements in the sequence table are
different from each other. The time complexity of the algorithm is required to be O(n2
), and then the function is called to output
all elements of the sequence table after processing. .
⑹ To sort the sequence table, the time complexity of the algorithm is required to be O(n ㏒ 2
n
), and then the function is called to
output the sequence table after processing.
⑺ Design a menu, and the above operation requirements are used as the main menu items in the menu.
11 / 43
6. Singly linked list operations
1. Problem description:
For a single circular linked list with a head node, write an algorithm function that implements the following operations.
2. Implementation requirements:
(1) The singly linked list creation function create: first input the data into the one-dimensional array A[M], and then
create a single circular linked list according to the one-dimensional array A[M], so that the order of the elements in the linked list is the same as that of the elements in A[M] The order is the
same, and the time complexity of the function is required to be O(m);
⑵ Locate lookup function Locate: find and return
the node pointer whose value is the first element of key in the established single circular linked list; If it is reached, it will return NULL;
(3) Find the element value with the largest and second largest value in the linked list, the time complexity of the algorithm is required to be
O(m), the largest and second largest element value is brought back through the pointer variable, the function does not need Return value;
⑷ Use all nodes in the linked list whose value is smaller than key (value key is passed in through formal parameters) as the
precursor of the node whose value is key, and all nodes whose value is larger than key are used as the successor of the node whose value is key, And try to keep the order between the original nodes
, the time complexity of the algorithm is required to be O(m);
⑸ Design a menu with the above processing requirements and the function of exiting the system.
12 / 43
7. Set operation (single circular linked list)
1. Problem description:
Sets A and B stored in a single circular linked list with two head nodes, whose element type is character or
integer, and are stored in a non-decreasing manner, The head nodes are ha and hb respectively. It is required that the
result also stored in a non-decreasing manner, and the result set does not affect the original set.
2. Implementation requirements:
⑵ Write the set element test function IN_SET, if the element is already in the set, return 0, otherwise
return
1 ;
The elements in the set are unique and are stored in a single circular linked list in a non-decreasing manner;
(3) Write a function to find the intersection C=A∩B of sets A and B, and output the elements of set C;
(4) Write a function to find sets A and B The function of union D=A∪B, and output the elements of set D;
⑸ Find the function of the symmetric difference E=(AB)∪(BA) of sets A and B, and output the elements of set D;
⑹ Design a menu, It has basic functions such as inputting set elements, finding the intersection C of sets A and B
, finding the union D of sets A and B, finding the symmetric difference E between sets A and B, and exiting.
3. Test data: The character type and shaping are determined by the students, but the number of elements in sets A and B should not be less than 15
.
13 / 43
8. Set operation (dynamic sequence table)
1. Problem description:
There are sets A and B stored in two dynamic sequence tables, whose element types are characters or integers and
are stored in a non-decreasing manner. It is required that the result set in the following problems is also stored in a non-decreasing manner, and the result
set does not affect the original set.
2. Implementation requirements: (
1) Write the set element test function IN_SET, if the element is already in the set, it will return 0, otherwise it will
return 1; (
2) Write the set element input and insert the function INSERT_SET into the singly linked list to ensure that
the elements in the input set are is unique and stored in the dynamic sequence table in a non-decreasing manner;
(3) Write a function to find the intersection C=A∩B of sets A and B, and output the elements of set C;
(4) Write a function to find the union of sets A and B D=A ∪ function of B, and output the elements of set D;
⑸ Find the function of the symmetric difference E=(AB)∪(BA) of sets A and B, and output the elements of set D;
⑹ Design a menu with input set elements, find intersection C of sets A and B, and find set A ,
the union D of B, the symmetric difference E between sets A and B, and the basic functions such as withdrawal.
3. Test data: set by the students, but the number of elements in sets A and B should not be less than 15.
14 / 43
9. Operation of double-ended queue
1. Problem description:
Double-ended queue: Double-ended queue is also a sequential access structure that restricts access locations. There are 3 ways:
① Allow enqueue and dequeue at both ends the double-ended queue. It can be regarded as two stacks connected together at the bottom of the stack, and
the top pointers of the two stacks extend to both ends. (Mixing of two stacks)
② A deque that allows one end to be inserted but both ends to be deleted. It can be seen as a mix of stacks and queues where the bottom of the stack and the tail of the queue are connected
together . The top of the stack can be inserted and deleted, and the head of the queue can be deleted. (mixing of stacks and queues)
③ A double-ended queue in which both ends are allowed to be inserted, but only one end is allowed to be deleted.
It can be seen as a stack and queue mix with the bottom of the stack and the head of the queue connected , the top of the stack can be inserted and deleted, and the tail of the queue can be inserted. (Mixed stack and queue)
2. Implementation requirements:
Suppose a double-ended queue without a head node is used to represent the double-ended queue. Front and rear are pointers to the head and
tail of the queue, respectively. Please write a function to implement the operation of the double-ended queue.
(1) Write four functions that can be queued and dequeued on the front side and rear side respectively.
(2) Write three functions that can only be dequeued at the front end but can be enqueued and dequeued at the rear end.
(3) Write out three functions that can only be dequeued at the rear end but can be enqueued and dequeued at the front end.
15 / 43
10. Matrix operations
1. Problem description:
Given two matrices A=(aij)m×n, B=(bij)p×q, complete the corresponding operations.
2. Implementation requirements: (
1) Write the matrix input function INPUT_MAT, through which the input of the matrix is ​​completed and the array of
saving . (Cannot use global variables)
⑵ Write the matrix output function OUTPUT_MAT, and complete the matrix output through this function.
(3) To find the transpose of the matrix, the transpose of the matrix A
'
=(aji)n×m, output the original matrix before transposing, and
output transposing.
⑷ Find the sum of matrices A and B. The conditions that matrices A and B can be added are: m=p, n=q; if matrices A
and B cannot be added, please give a hint; if they can be added, sum matrix C and output C.
C=A+B=(cij)m×n, where cij=aij+bij
⑸ Find the product of matrices A and B. The conditions for the multiplication of matrices A and B are: p=n; if matrices A and B
cannot be multiplied, please give a prompt; if they can be multiplied, multiply matrix D and output D.
D=A×B=(dij)m×q, where dij=∑aik×bkj, k=1,2,...,n
⑹ Design a menu, which has the functions of finding the transpose of the matrix, finding the sum of the matrix, and finding the matrix
Basic functions such as accumulation and exit . When calculating the sum of matrices or the product of matrices, it is required to be able to prompt the input of two matrices first,
and then perform corresponding operations.
http://www.daixie0.com/contents/14/1313.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=325217676&siteId=291194637