Circular Singly Linked List (Counting the Number of Elements)

preview_player
Показать описание
Data Structures: Counting the Number of Elements/Nodes of a Circular Singly Linked List
Topics discussed:
1) C program for counting the number of elements of a circular singly linked list.

Music:
Axol x Alex Skrindo - You [NCS Release]

#DataStructuresByNeso #DataStructures #CircularLinkedList #LinkedList
Рекомендации по теме
Комментарии
Автор

Another possibility, which we observed in your print function is:

temp = tail -> next ;
do {
count++;
temp = temp -> next;
}
while ( temp!=tail->next);

This forces the function to atleast carry out the loop once (the first time when temp = tail -> next ) and it stops the next time temp = tail -> next.

poorvisaxena
Автор

Too much exited for upcoming videos these are really helpful

dipsardar
Автор

Sir, can we initialize the count variable with 1?

AdityaMukherjee-ojlf
Автор

thank you for making this presentation😍

AbdurRahman-phms
Автор

sir please increase speed of uploading videos atleast 2 in one day in data structure playlist

vishalgiri
Автор

if int count is initialized by 1 then we don't need count++ after while loop?

Rpshailu
Автор

Here is another variation:

int countList(struct node* tail) {
if(tail == NULL)
return 0;
if(tail->next == tail)
return 1;
struct node *temp = tail->next;
int count = 1;
while(temp != tail) {
count++;
temp = temp->next;
}
return count;
}

DaiMoscv
Автор

Is there any way to count the nodes using only one pointer ie reference to a node (without declaring the temp pointer)??

aniketroy
Автор

Sir what about control system and aptitude please upload the vedios.

gowriv
Автор

Waiting for videos on stack data structure

preranakokane
Автор

Sir when will the complete Data Structures be uploaded ?

iamsrinandavikassadhanala
Автор

We want C++ course from you guys..please🥺

nikhilsastry
Автор

sir avl tree implementation krwa do please ..

mohdsarim
Автор

this is too good after code with harry ....the way presenting and explaining are too good

anjalisoni