How to search data in a linked list in c?
We can search a linked list using binary search technique directly. Since linked list nodes are allocated in contiguous memory location, binary search works on linked list also.
the only way to search linked list is, dump the data into array of structures & apply binary search technique on the arrays.
The only way to search a linked list is with a linear search, because the only way a linked list’s members can be accessed is sequentially. Sometimes it is quicker to take the data from a linked list and store it in a different data structure like array, so that searches can be more efficient (like binary search).
all of the above mentioned techniques can be used for searching a linked list.
Back To Top