answersLogoWhite

0


Best Answer

Circular linked lists are really no different to ordinary linked lists, other than that the tail node points back to the head node (and vice versa if the list is doubly-linked). Therefore the merge process is exactly the same: iterate through the second list and insert each node's data into the first list. Since lists are un-associated containers, it doesn't matter where the insertions occur but, by convention, insertions typically occur at the tail of the list. If an order must be maintain, an insertion sort should be employed instead. Note that if you need to maintain the original two lists (in their un-merged state), simply copy the first and insert the second into the copy instead.

User Avatar

Wiki User

9y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the code for c and c plus plus program to merge two circular linked list?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Explain Pseudo code for circular linked list?

write pseudocode for link list


Is there any chance a computer that convert the program into machine language is called as a interpreter?

No. Computers do not convert program source code into machine code, period. That job is the responsibility of another piece of software, known as the interpreter or compiler, a machine code program which effectively tells the computer how to perform the translation from source code to machine code. The computer cannot do this job by itself as computers only understand machine code and nothing else. An interpreter simply converts each statement of source code into the equivalent machine code and executes it, one statement at a time. This is extremely slow because subroutines that are called many times must be translated each time they are called, for instance. Thus the source code must always be executed within the interpreter software. A compiler, on the other hand, converts the entire source program into object code which can then be linked to produce the required machine code. Once linked, the machine code will execute without any further interpretation, and is therefore known as a standalone executable.


What is pseudo code algorithm for create a linked list with a header and insert a four numbers to the list?

pseudo code algorithm to create a linked list


Is C plus plus interpreted as the program is executed?

No. Neither C nor C++ are interpreted. Both need to be compiled and linked to produce highly-optimised machine code, which is then executed.


What do you mean by running of a program in c plus plus?

In order to run a C++ program the program must be compiled and linked to create an executable. It is the executable that actually runs, not the source code. The source code is simply the human-readable code the compiler requires to generate object code for the linker which produces the machine-readable code. However, when the executable is executed within a debugging environment, we can set breakpoints in the source code and step through the source code just as if the source itself were executing, as would be the case if C++ were an interpreted language. Unlike an interpreted language where we can change the source code and see the results immediately, the source code (or at least the portion that has changed) must be recompiled to accommodate the changes.

Related questions

Explain Pseudo code for circular linked list?

write pseudocode for link list


How can you find out if a linked list is circular?

Pseudocode for detecting loops in a linked list: // keep track of which linked list nodes we've visited set nodesVisited // our list linkedlist list // current working node node current = list.root while current.next is not null if nodesVisited contains current.next we found a loop! else nodesVisited.add( current ) current = current.next // if we get here without finding a loop, then there are no loops Complete Working code And illustrative pictures can be found here about linked lists http://www.programmerinterview.com/index.php/data-structures/how-to-find-if-a-linked-list-is-circular-or-has-a-cycle-or-it-ends/


What processing is needed to transfer a c program to a MACHINE language?

C source code is first converted to object code by a compiler, one translation unit at a time. The resultant object files are then linked together to produce a machine code executable.


Can a hyperlink be linked to a email address?

An email link requires the following code: <a href="mailto:email@address">Email Me</a> This will open your email program with a new email with that address in the To: field.


Can a hyperlink be linked to an Email address?

An email link requires the following code: <a href="mailto:email@address">Email Me</a> This will open your email program with a new email with that address in the To: field.


Is there any chance a computer that convert the program into machine language is called as a interpreter?

No. Computers do not convert program source code into machine code, period. That job is the responsibility of another piece of software, known as the interpreter or compiler, a machine code program which effectively tells the computer how to perform the translation from source code to machine code. The computer cannot do this job by itself as computers only understand machine code and nothing else. An interpreter simply converts each statement of source code into the equivalent machine code and executes it, one statement at a time. This is extremely slow because subroutines that are called many times must be translated each time they are called, for instance. Thus the source code must always be executed within the interpreter software. A compiler, on the other hand, converts the entire source program into object code which can then be linked to produce the required machine code. Once linked, the machine code will execute without any further interpretation, and is therefore known as a standalone executable.


What is pseudo code algorithm for create a linked list with a header and insert a four numbers to the list?

pseudo code algorithm to create a linked list


Is C plus plus interpreted as the program is executed?

No. Neither C nor C++ are interpreted. Both need to be compiled and linked to produce highly-optimised machine code, which is then executed.


What is the code for palidan slayer in aqw?

there is no single code, you must buy the expansion packs or use someone elses code who has them but not used the codes. you need to merge both doomwood and chaos lord expansion packs, so you type in UNIQUE codes from each and then merge the two items.


How do you convert a code for example '62020166621000E2' to a message like 'Pink Pencil' Do I need to make a program or is there already something like that?

That would depend if your code is a published code (most bar codes are). If this is the case then there are web places to look up what the code is linked to. See the related link below for one possible example.


What linked the Eastern US to the west?

mores code


How does a C plus plus code execute on a computer system?

C++ is plain-text source code -- it cannot be executed. It must first be compiled and then linked to produce a machine code file specific to the hardware you are targeting. That is, a C++ program compiled and linked for Windows platforms will not execute on Mac or Linux platforms -- it must be compiled and linked separately on each platform. If the source code includes platform-specific libraries and code, compiler directives can be used to filter the correct libraries and code for each platform being targeted. Once compiled and linked, the resulting machine code file (typically an EXE or DLL) can then be executed. Some sources are intended to build static libraries (LIB files). These cannot be executed as they are intended for static linking (achieved during the link process). The C++ Standard Library is typically implemented via static libraries.