I would like to ask you a question about data structure.

Linear table (A1 ~ (2),. , ai-1,ai,ai+1,. , an), uses a single linked list storage, the head pointer is H, each node stores an element in the linear table, and now looks for a node with an element value of x. Write the search statements for the following three cases respectively, requiring the search time to be as short as possible.
(1) the elements in the linear table are out of order.
(2) the elements in the linear table are incrementally ordered.
(3) the elements in the linear table are in descending order.

now that linked lists are used, whether the data is orderly or not has no effect on traversal. Can"t do


(1) unless you finish traversing the linked list, you cannot be sure that the element does not exist.
(2) (3) can determine that the element does not exist halfway and return in advance.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1ea9cd8-47d4a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1ea9cd8-47d4a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?