How do you find out if a linked-list has an end, Computer Engineering

By 2 pointers you can find it. One of them goes 2 nodes each time. The second one goes at 1 node each time. If there is a cycle, the one that goes 2 nodes every time will eventually meet the one that goes slower. If that is the case, then you will identify the linked-list is a cycle.

 

 

Posted Date: 4/8/2013 5:21:02 AM | Location : United States







Related Discussions:- How do you find out if a linked-list has an end, Assignment Help, Ask Question on How do you find out if a linked-list has an end, Get Answer, Expert's Help, How do you find out if a linked-list has an end Discussions

Write discussion on How do you find out if a linked-list has an end
Your posts are moderated
Related Questions
Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec


Bespoke versus off-the-shelf software Generally software packages are bought off-the-shelf. Though, certain applications (generally for industrial companies, commercial busines

In binary representation there are some states that are believed to be never occurred because of some particular functionality of a given circuit. If zero output is assigned to suc

What types of data entry services do you perform? Our business is to understand what data you require entered and in what particular format. After an initial analysis is perfor

Multi-Threaded Processors In unit 2, we have gone through the use of distributed shared memory in parallel computer architecture. Although the use of distributed shared memory

Functional units of a computer system: Digital computer systems consist of 3 distinct units. These units are as follows:  Central Processing unit Input unit and Output unit.

Difference between the fork -join and begin-end. The fork - join keywords: Groups several statements together.Cause statements to be evaluated in parallel (all at the same

Q. Functions for various communication modes? MPI offers both non-blocking and blocking send/transmitting and receive operations for all modes. Functions for various commun

What is Machine.config?  Machine configuration file: The machine. config file contains settings that apply to the whole computer.  The machine.config, which can be found in the