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
Applications Of Parallel Processing Parallel computing is an development of serial computing that effort to emulate what has always been the affirm of affairs in the natural wo

Explain Resource request and allocation graph (RRAG) Deadlocks can be explained by a directed bipartite graph known as a Resource-Request-Allocation graph (RRAG).A graph G = (V

What are the two primary models of Supply Chain Management? The Two Primary models of Supply Chain Management are:- 1.  Porter's Value Chain Model 2. Supply Chain Model

Ferroelectric RAM is a random-access memory same in construction to DRAM but uses a ferroelectric layer rather of a dielectric layer to achieve non-volatility. FeRAM is one of a gr

Q. Illustrate control and timing signals? The requirement of I/O from different I/O devices by processor is quite unpredictable. In fact it relies on I/O needs of particular pr

Explain the life cycle of a process Each procedure has a life cycle, which consists of execution, creation and termination phases of the procedure.  A method may create severa

Locality of reference implies that the page reference being made by a process is Ans. Locality of reference means that the page reference being made through a process is proba

Q. Explain Segment Registers in bus interface unit? These are very significant registers of CPU. Why? We will answer this later. In 8086 microprocessor memory is a byte organiz

What is "Common Type System" (CTS)?  CTS explain all of the basic types that can be used in the .NET Framework and the operations performed on those type. All this time we hav

Use 4 D-bascules connected in serial all synchronized with the similar CLK. Then connect all 4 outputs, & 2nd output must reverse, of the D-bascule to an AND logic. The output of t