In beginning Both Head and Tail point to next node in list. How to write code for this in function
Type: Posts; User: Djsarkar
In beginning Both Head and Tail point to next node in list. How to write code for this in function
I have expended code bit in post #6 and shown behavioral picture diagram for list in post #9. Now I need your help in appendNode function. I don't understand what should be inside the function
The sample code I posted is idea of @laserlight
The head always points to the "start" and the tail always points to the "end".
What I need to do if I want to add node in end of list
#include<stdio.h>
#include<stdlib.h>
struct Node
{
int Value;
struct Node *Next;
struct LinkedList *List = NULL;
struct LinkedList List = {NULL, NULL};
Do these two lines means same or Is there a difference between two lines ?
Hi
anyone can help me to understand following sample example code for linked list
struct Node{
int Value;
struct Node *Next;
};
struct LinkedList
{
would you please help me to explore function.
List is a structure variable in which you are assigning null value twice but I have never seen this type of initialize
struct LinkedList...
I'm going to make list in which I have two pointer's head and tail. I understand that head always point to first node in list and tail always point to last node in the list. When new node is added in...
No doubt you have given such wonderful answer but my question was does both X and Y are same or difference because I don't see any difference in accessibility and life time
Thank you both of you
yes we can use extern storage class but what if I write the program as shown in opening post
Is there any difference between them in standard c ?
Are they same or...
Hi,
I am little bit confused I don't understand difference between global variable and static variable that declare outside function.
#include<stdio.h>
int X = 10; //Global variable ...
Hi
I don't understand difference between int and long type ?
#include <stdio.h> int main() {
int x = 1;
long y = 1;
I don't understand the algorithm for non-sorted. I am having trouble counting the number that is repeated more than once. I tried so many times but still struggling
No the process shown in flowchart to find repeated number in list not to count number
I don't understand how your algorithm will implement
I am trying to fix flow chart
16141
I have set one counter to count repeated number but it's not work as I want
#include <stdio.h> int main()
{
int list [5] = {1, 2, 1, 2, 4};
int i = 0; int j = 0; int counter...
I guess method is for without sorting array
Ok so I am sorting array
#include <stdio.h>
int main()
{
int i = 0; int j = 0;
int list[5] = {1, 2, 1, 3, 4};
Thanks
#include <stdio.h>
int main()
{
int i = 0; int j = 0;
int list[5] = {5, 4, 3, 2, 1};
If we have X = 1 and Y = 3 when we will swap it would X = 3 and Y = 1
X=1, Y=3, Temp = 0
Temp = X=1
X = Y = 3
Y = temp = 1
After swapping X =3 and Y = 1
When we have
list = 5 4 3 2 1
how to sort array in increasing order ? list = 1 2 3 4 5
here is process how I think
5 - 4 compare if greater then update 4 5 3 2 1
5 - 3 compare if...
I can find repeat number in array but problem with counting how many time they are repeating
I still do not understand counting
I think I'm following the first approach. Do I need loop after the if condition to count the repeated number?
The size of my list is small because I want to write the program just for small list....
But I do not understand how to count when repeated number found
#include <stdio.h> int main()
{
int list [5] = {1, 2, 1, 2, 1};
int i = 0; int j = 0;
int test = 0;
right
#include <stdio.h>
int main()
{
int list [5] = {1, 2, 1, 2, 4};
int i = 0; int j = 0;
for (i=0; i<5; i++)