Two Data Structure Exercises High Score 100

Updated on technology 2024-03-06
6 answers
  1. Anonymous users2024-02-06

    I think you can read the book and make it up yourself, so why don't you think about it yourself, and then put your questions out to everyone.

  2. Anonymous users2024-02-05

    I won't do that either, though, 2 points in hand!

  3. Anonymous users2024-02-04

    1. Multiple choice questions.

    1.c2.d

    Analysis: a A full binary tree can be stored in an array, and the tree is a nonlinear structure.

    b Linked lists, and the insertion and deletion are efficient.

    c Linked lists also have bidirectionally linked lists with two pointer fields.

    3 a4 a sequential tables provide random access to any element.

    5 d6 Are you getting this question wrong?

    7 d full binary tree: the total number of nodes n=2 h -1 h is the number height, and the total number of nodes is 255

    Full binary tree, there are only nodes with degrees of 0 and degrees of 2, and nodes with degrees of 0 are equal to degrees of 1 and the number of nodes is +1 so d is chosen

    8 c This problem can be made without drawing, the post-order traversal sequence is dabec,-- the root node is: c

    pre-order traversal; Root left and right, so the first one must be c and only the a term is met.

    9.A Although you don't give a diagram, it's generally a phase, because I've seen a lot of this problem, and the results of the middle order traversal and the hierarchical traversal are the same.

    10.d In the worst-case scenario: the number of comparisons is n times from the first to the last for each lookup

    The total number of comparisons is n*n, and the average number of comparisons is n

    13.2. Fill in the blanks.

    1 Out of the stack. 2.n/2+n/(n+1) 1+2+3……n+n)/(n+1)=.n/2+n/(n+1)

    3 14 Let the keywords of the data elements to be sorted be (67,24,14,22,33,15,11,15), and use the selection method to sort them in ascending order, and the number of times to be compared is [ ].

    7 15 Method Same as the multiple-choice question on the full binary tree.

    8 No figures. 9.16 Same method as Question 7.

  4. Anonymous users2024-02-03

    1 b2 a

    3 b4 ?

    5 c6 d

    7 b8 c

    9 c10 b

    Refer to the answers of the first two and your own thoughts

    I feel like the one on the first floor explains a lot.。。 But it's not very accurate.

  5. Anonymous users2024-02-02

    2.Answer, a, this is based on the definition of a circular queue, and when dealing with the overflow of a circular queue, the textbook does not use empty digits, so the number of elements in the queue (rear-front+m)%m; The +m is because rear-front<0 is possible

    3.For empty queues, front=0; at the beginningThat's fine. When the queue is not empty, the front and rear point to the head element and the tail element respectively, which is different from the pointer at the end of the queue in the book, so the number of elements in the queue is calculated as follows:

    rear-front+1+n)%n;front=0;At first, there are no elements in the team, so rear=n-1; So choose B

  6. Anonymous users2024-02-01

    The first thing you need to do is understand the characteristics of the "stack". "First in, last out".

    5 into the stack, 2 into the stack, 4 into the stack, at this time [524.].After that, 4 is out of the stack, and at this time it is [52], in order to get the top element of the stack. So x is 2

Related questions
5 answers2024-03-06

I would like to introduce you to Yan Weimin's textbook "Data Structure" (C language version), which is currently a classic textbook with a good reputation in China. >>>More

16 answers2024-03-06

Just o(n) scans it once, millions of arrays are not big, and c can be opened so big for global variables. >>>More

9 answers2024-03-06

A hash table (also known as a hash table) is a data structure that is directly accessed based on the key value. That is, it accesses records by mapping key values to a location in the table to speed up lookups. This mapping function is called a hash function, and the array that holds the records is called a hash table. >>>More

5 answers2024-03-06

The algorithm is similar, but the language description is different, C is the basic! However, the C++ language is relatively simple, so it's good to get used to which one!! The data structure is mostly used in C++, it depends on which version of the textbook you use, if you learn C++, then use the C++ version of the textbook, the problem is not very big!! >>>More

6 answers2024-03-06

A data structure is the way a computer stores and organizes data. A data structure is a collection of data elements that have one or more specific relationships with each other. Often, a well-chosen data structure can lead to higher operational or storage efficiency. >>>More