answersLogoWhite

0

store the exor of the previous node address and next node address in each node of single linked list .further exor the nodes to proceed forward or backward as necessary

User Avatar

Wiki User

16y ago

What else can I help you with?

Continue Learning about Engineering

What is difference between Deep copy and shallow copy?

A "shallow" copy is when the member values are physically copied from one object to another, *including* the values of any pointer or reference members. If there are pointer or reference memebrs, then, those poointers or references refer to the *same* objects as the original object, which is usually a bad thing. That's why you want to define a copy constructor and assignment operator for objects that contain pointers or references. It's called a "shallow" copy because only the values of the pointers/references are copied, instead of making copies of those referred-to objects and setting pointers to them. *That* is what would be called a "deep" copy, because it's going "deeper" into the structure, copying everything, not just the first "layer".


Describe why it is a bad idea to implement a link list version a queue which used the head of the list as the rear of the queue?

It isn't. In fact it is a very good idea. Since the list is circular, you need only maintain a reference to the tail (rather than the head), because the tail provides constant time access to both the head and the tail. In this way you get constant time insertions at the tail and constant time extractions at the head via a single reference -- exactly what you want from a queue. If the list were not circular, you would need two references, one to the head and one to the tail. That's a waste of memory when the tail has an otherwise redundant link that's always null. Point it at the head and refer to the tail instead of the head and you save memory.


Why in oscillator triode is used instead of transistor?

I do not understand your question, oscillators CAN be built with either (and many other amplifying components). A few examples are:triode tubetetrode tubepentode tubebeam power tubepentagrid converter tube (cathode and first 2 grids form local oscillator)magnetron tubeklystron tubetraveling wave tubethyratron tubeneon lamppoint contact transistorjunction transistorsurface barrier transistorfield effect transistortunnel diodeunijunction transistorsilicon controlled rectifiermagnetic amplifierFERRACTORoperational amplifier ICtimer IClogic inverter ICetc.Perhaps you meant why it was in some specific circuitthat you don't give any reference to. If this is the case, I cannot answer without a reference to the specific circuit. One possibility for selecting a tube instead of a transistor to implement an oscillator would be that it must deliver higher power and/or voltage than a transistor is capable of.


What are simulating pointers?

Simulating pointers typically refers to techniques used in programming languages that do not support direct pointer manipulation, such as Java or Python. Instead of using pointers to reference memory locations, these languages use object references or indices to achieve similar functionality. For example, arrays or lists can act as simulated pointers by allowing access to elements through their indices. This approach helps manage memory safely while still enabling dynamic data structures.


Detail about independence reference in c plus plus?

An independent reference (or simply a reference) is an alias to an existing reference. int a = 42; int& ref = a; // independent reference In the above code, ref is a reference to the object named a. If you modify the value of ref then you modify the value of a -- they are one and the same object. This can be proved as follows: ref *= 2; // double the value of ref assert (a==84); // verify a has also doubled References are a bit like constant pointers. That is, once assigned, they cannot be reassigned, they must always refer to the same object, just like a constant pointer: int* const ptr = &a; The difference is that a pointer (even a constant pointer) is a variable and therefore requires memory of its own to store the memory address of the object being pointed to. A reference does not; a reference is simply an alias -- an alternate name for an object. Also, unlike a pointer, a reference cannot be null -- it must always refer to something valid. Moreover, the object it refers to must be guaranteed to outlive the reference itself. For example: int* ptr = new int(42); int& bad_ref = *ptr; // refer to the object pointed to by ptr (the int with value 42) delete ptr; At this point, what is bad_ref referring to? The integer pointed to by ptr no longer exists (we just deleted it), so bad_ref is now referring to memory that no longer belongs to our program. The value may still exist at the original memory location, but now the memory is released to the system, any external process can modify that memory behind our backs. Thus any future attempt to access that memory via bad_ref would result in undefined behaviour. Therefore never refer to dynamic memory unless you are absolutely certain that memory will outlive the reference. Reference are predominantly used when passing objects to functions by reference. Passing by reference can be achieved either by passing a pointer or passing a reference. But in cases where a pointer must be non-null and the pointer must be constant, passing by reference is the preferred option. Consider: void f1 (int* const p) { if (p) { *p *= 2; // double the value being pointed at. } } Every time we call this function we must test p to ensure it is non-null before we can access the memory being pointed at. If we pass by independent reference instead, we can eliminate the unnecessary test: void f2 (int& r) { r *= 2; // double the value being referred to by r } Can we always be certain r never refers to a null object? No, we cannot. Consider the following: int main() { int* p = nullptr; f1 (p); // OK f2 (*p); // unhandled exception: access violation! } You might ask where's the benefit, but the benefit comes from the calling convention itself. Function f2() expects a non-null reference therefore that is exactly what we should pass. *p is an invalid reference because p is a nullptr, so the problem is not the function, it is the caller. Although function f1() can handle invalid references gracefully, the point is that we don't want to pass invalid references to this particular function at all, and f1() does not alert us when we do. If an exception occurs then the program is invalid, so the exception forces us to rectify that. In this manner we achieve more robust and efficient code. If a reference argument is optional, then of course a pointer makes more sense (typically defaulted to nullptr). Similarly if we need to refer to different objects through the same pointer argument (non-const pointer). But when a reference is not optional and must refer to the same object, an independent reference makes the most sense.

Related Questions

What is the way to verify that a formula references the cells you want it to reference?

Use absolute references. e.g. $B$12 instead of just B12.


Is it ever okay for your references to contact a potential employer instead of them contacting your references?

If your reference has a prior relationship with the potential employer then the contact would make sense. If not, no.


What is an easy way to verify that a formula references the cells that you want it to reference in excel?

Use absolute references (e.g. $C$3) instead of relative references (e.g. C3). See related questions for more information about absolute references.


What characters is used in Excel to change a relative cell reference to an absolute cell reference?

The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.The $ is used to make a mixed or absolute reference.A1 is a relative reference.$A1 and A$1 are mixed references.$A$1 is an absolute reference.


Which references should you not include on a resume?

You should generally avoid including personal references, such as family members or friends, on your resume. Instead, consider providing references upon request from potential employers, including professional contacts or previous supervisors who can speak to your qualifications and work ethic.


Does APA require a page titled Works Cited?

No, APA style does not use a page titled "Works Cited." Instead, APA utilizes a page titled "References" for listing all sources cited in a paper. The references should be listed alphabetically by the author's last name.


What is a bibilyography?

References. Bibliography is another word for references, but most people nowadays just use Bibliography instead of References.


Can you ask a prospective employer to see references that have been submitted to them I have gone on a lot of interveiws and thought I had the position only in the end to get rejected.?

Normally, reference is made privately. When employers talk to the references that you provide, those are private conversations between the employer and your reference. You would likely have better luck asking your reference what s/he has told the prospective employer instead. As a general rule, the reference you provide is likely to provide "good" details about you. If you are rejected nonetheless, why would you suspect your reference(s) sabotage you, other than that you're just not good enough for the job, or that the interviewer(s) just don't like your face?


How can insert a row in excel sheet without changing the formula?

Change the formula to use absolute references instead of relative references. Instead of =A2+B3, use =$A$2+$B$3.


Are works cited used on apa title papers?

In APA style, a separate reference page is used instead of a works cited page. The reference page lists all sources cited in the paper and follows specific formatting guidelines outlined in the APA Publication Manual.


Does Vlad Dracula and Bram Stoker Dracula common?

Bram (Abraham) Stoker did try and make strong reference between Count Dracula and Vlad Tepes Dracula in his book but the references he gave were erroneous so instead of making a strong connection between the two he instead gave Vlad an alibi.


Would NOT be appropriate as a supporting document for your application Cover letter Professional references list Follow-up correspondence Performance review from a previous?

A performance review from a previous employer would NOT be appropriate as a supporting document for your application. While it provides insights into your past job performance, it is not directly relevant to the specific job you are applying for. Instead, a cover letter, professional references list, and follow-up correspondence are more aligned with showcasing your qualifications and intent for the position.