Simulation Data Structures
Array
Stack???????? You can only insert data at the same end, delete data on the same side, and then exit.
Queue???? Only allow data to be inserted at one end, delete data on the other, FIFO
CPU (Center processor Unit)
Array_pop ();???? Deletes an element from the end of the array, returning the element that was deleted
Example:
Array_push ();???? Appends an element to the end of an array, returning the array length after adding a new element
Example:
Array_shift ();???? Deletes an element from the head of the array and returns the deleted element
Example:
Array_unshift ();???? Adds an element to the head of the array and returns the array length after adding a new element
Example:
Simulation stack: Because the operation rules of the stack is to add and delete data at the same end, using Array_pop, Array_push and Array_shift, array_unshfit simulation stack operation
Queue operations: Because the rules of the queue are added at one end to delete at the other end, you can use Array_unshift, Array_pop and Array_push, array_shift to simulate queue operations.
Array_keys ();???? Gets the key names of all the elements in the array and returns them as an indexed array.
Array_values (); Gets the key values of all the elements in the array and returns them as an indexed array. it is convenient to convert an associative array into an indexed array
Example:
Array_key_exists ();???????? Used to determine if a key name exists, there is a return of true, there is no return false
In_array ();???????????????? Used to determine if a key value exists.
Example:
Implode ();???????????? Used to stitch an array element into a string by a specified delimiter.
Example:
Count ();???????? Used to get the length of an array
Range (m,n);???????? Used to return the characters between M and n by the Unicode encoding m and N, and to organize the array returns
Example:
Simulation Data Structures