|
List->Dynamic List->Key Search |
||
| By this time you
know what is a key and how does a sequential search work, otherwise,
refer the static list 'key
search' section.
Similar to Traversal, here also we will take an auxiliary pointer, current, which initially points to the beginning of the list and then surfs through the list comparing the KEY value with each nodevalue in the list and we return true if the key is found or else false. Algorithm:- C implementation:- keysearch ( int key) Note:-Generally Key search returns you the position of the Key in the list (if its there) but I have deliberately skipped that to make it simpler. Related Operations: |
||
| Index || Doubts / Clarifications || Related Topics || Web Links | ||