create an SINGLE LINKED LISTS and reverse the data in the
lists completely
Answer Posted / akansha sharma
create linklist, with node having DATA which contain
information and NEXT which cointain address of next node.
The pointer START pointing to first node of linklist. PREV
pointer point to first node(where START point) and TEMP
pointer which point at last node(by traversing).
Swap data of TEMP and PREV. Now increment TEMP(TEMP=TEMP-
>NEXT) and decreament TEMP.
Repeat this untill TEMP=PREV
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why main is used in c?
Why is it usually a bad idea to use gets()? Suggest a workaround.
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
Is boolean a datatype in c?
What is a file descriptor in c?
What are 3 types of structures?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }
How do we declare variables in c?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
Why ca not I do something like this?
You have given 2 array. You need to find whether they will
create the same BST or not.
For example:
Array1:10 5 20 15 30
Array2:10 20 15 30 5
Result: True
Array1:10 5 20 15 30
Array2:10 15 20 30 5
Result: False
One Approach is Pretty Clear by creating BST O(nlogn) then
checking two tree for identical O(N) overall O(nlogn) ..we
need there exist O(N) Time & O(1) Space also without extra
space .Algorithm ??
DevoCoder
guest
Posted 3 months ago #
#define true 1
#define false 0
int check(int a1[],int a2[],int n1,int n2)
{
int i;
//n1 size of array a1[] and n2 size of a2[]
if(n1!=n2) return false;
//n1 and n2 must be same
for(i=0;i
In a byte, what is the maximum decimal number that you can accommodate?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What is the use of header?
in programming languages a statement or part of a statement that specifies several different execution sequences a) constructs b) distructs c) executes d) none