Data Structures Key Mind

Linear table

Array

The array is stored in memory element continuously, since the same memory for each element can be accessed by any element in the array subscripts rapidly. However, if an element in the array to increase, the need to move a large number of elements, the memory space in a hollow element, the element to be added and then placed therein. By the same token, if you want to delete an element, you also need to move large amounts of elements to be moved to fill out the elements. If the application requires fast access to data, with little or no insert and delete elements, you should use an array.

List

List the contrary, the list of elements is not sequentially stored in memory, but is linked together by the presence of a pointer element. For example: the element has a pointer pointing to the next element, and so on, until the last element. If you want to access a list of elements need to start from the first element, the element has been to find the desired position. But adding and deleting an element for the linked list data structure is very simple, as long as the modified elements pointer on it. If the application requires frequent insert and delete elements you will need to use a linked list data structure.

Description link

Stack

Stack (Stack) limiting the insertion and deletion only one position in the table, the position of the end of the table is called stack top (top). Basic operation of the stack with a push (push) and pop (the stack).

There are two stacks achieved:

  1. List
  2. Array

Stack of applications

  1. Matching brackets
  2. Expression evaluation
  3. Function call

queue

And an end of the stack except that the feed out end.

Queue application

Of resources waiting to be processed


Reproduced please indicate the source, welcome to the article cited sources of research, please point out any errors or expression is not clear enough. In the comments section below you can comment or e-mail to [email protected]

Original: Big Box  Data Structures Key Mind


Guess you like

Origin www.cnblogs.com/chinatrump/p/11596988.html