Traversing the List (Linked List vs. Arrays)

preview_player
Показать описание
Data Structures: Time Complexities of Linked Lists and Arrays while traversing the list.
Topics discussed:
1) Comparing the time complexities of the singly linked list and the arrays while traversing a list.

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

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

SIR!! you're teaching amazing! upload more of these DS topics. Thankyou. :)

kisabatool
Автор

videos are very shot and straight to business much love

frankwillimasugwu
Автор

So many videos i saw to understand this concept, buy you are realy great sir you explained in 4 minutes that to very easily .thankyou so much sir.

shruthig.rshruthi
Автор

Sir, you have been teaching amazingly! I am so glad to be learning from here. Thank you so much! I am GATE 2021 aspirant and wanted to know the approximate time for the completion of this course.

sanyagandhi
Автор

Thank you neso academy u are helping a lot..

avularaghavendra
Автор

Please provide the video lectures of rest of the topics of data structure for preparation of gate..

deepalikatara
Автор

For counting complexities in the array to be O (n), sizeof must also be O (n). Is O (n) the sizeof?

canalbomon
Автор

But, will internally the Sizeof(arr) and sizeof(int) functions do take time?

rebinkurian
Автор

Sir I am confused that traverse the linked list and traverse arrays are two different topic or same

ShaukatAli-tuwd
Автор

Why ptr is assigned as null before assigned as head?
We can also directly assigned to head.

krishpatel
Автор

I think we can merge the counting part into traversing part...

sahil
Автор

Right now 24.7 lakh subscriber and 1.5 lakh view😅🎉

pheonixway
Автор

at 00:01:02 in BOTH FUNCTIONS
instead of...
\\struct node *ptr=NULL;
ptr=head; \\

why can't we just put--
\\struct node *ptr=head;\\

Syt
Автор

sizeof function give the size of integer not the number of elements

qazafipalestine
Автор

I have completed data structure but I am eager to Study Tree and Graph Data Structure,

adityamishra
Автор

Its not running . Why ?? Can anyone tell
Program from last video

// PROGRAM TO PRINT 5 NODES OF A LINKED LIST WITHOUT USING LOOP.

#include <stdio.h>
#include<stdlib.h>

struct node
{
int data;
struct node *link;
};


int main ()
{
//NODE 1
struct node *head = malloc(sizeof(struct node));
head->data = 100;
head->link = NULL; // head or start

//NODE 2
struct node *current = malloc(sizeof(struct node));
current->data = 200;
current->link = NULL;
head->link=current; //linking 1st and 2 node by arrow operator

//NODE 3
current = malloc(sizeof(struct node));
current->data = 300;
current->link = NULL;
head->link->link->current;

//NODE 4
current = malloc(sizeof(struct node));
current->data = 400;
current->link = NULL;


////NODE 5
current = malloc(sizeof(struct node));
current->data = 500;
current->link = NULL;


print_data(head); // calling of function to prine 5 nodes of linked list
return 0;
}


// FUNCTION TO PRINT OP LL

void print_data(struct node *head){
if(head==NULL)
printf("LINKED LIST IS EMPTY");
ptr=head;

while(ptr!=NULL){
printf("%d", ptr->data);
ptr=ptr->link;}
}

all-rounderchannel
Автор

Why not combine the two functions for the linked list (count_of_node and print_data).
Add the printf function from print_data() to count_of_node() function then before printing count we print a new line.

lawrencemuthui
Автор

any other morocan or abian people here ?

omarelmoujahid