A possible max length is not the actual the length of node.

guest (Sean)
It's a possible max length. F.g. A node need 12 bytes. In a XXMbytes memory computer, we can set the possible max length to use up all the memory of the computer. That's XXM/12bytes.

We go throught the list, and count the number of the node, if the number is larger then the value XXMbytes/12bytes, we can say there is a cirle in the list.

Because we don't need other more memory, and just go throught the list, and count the number. we don't need tough cpu time.
2001-7-24 -04:00
This post has been archived. It cannot be replied.
Page address has been copied. To share, click to copy page address.
Share Online by QR Code

Back To Topic: 看了#142300,也来贴一道MS研究所在中国招聘的考题......

Back To Forum: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论