Array as An Abstract Data Type in Data Structures(With Notes)

preview_player
Показать описание
How an array can be represented as an Abstract data type: In this video we will see this and other details about ADTs

Best Hindi Videos For Learning Programming:

►C Language Complete Course In Hindi -

►JavaScript Complete Course In Hindi -

►Django Complete Course In Hindi -

Follow Me On Social Media
Рекомендации по теме
Комментарии
Автор

I need your help in reaching out more students with this course!
Instagram: instagram.com/codewithharry
Make sure to download the notes. Hope you are enjoying! 😊✌

CodeWithHarry
Автор

**WAKES UP**

Code With Harry posted a video 7 minutes ago...
Me: Today is gonna be a good day.

neillunavat
Автор

The only good thing happened in 2020 is that I found your channel. The best thing is i get all videos in sequence, with all topic i need covered.

harshkathiriya
Автор

#include<iostream>
using namespace std;

template<class T>
class ADTArray
{
T arr[20];
int total_size=20;
int used_size;
public:
void display()
{
for (int i = 0; i < used_size; i++)
{
cout<<arr[i]<<" ";
}
cout<<endl;
}
void get(int i)
{
cout<<"The "<<i<<"th element is "<<arr[i]<<endl;
}
void set(int i, T num)
{
arr[i]=num;
}
void setArray(int N)
{
int ele;
used_size = N;
for (int i = 0; i < used_size; i++)
{
cin>>ele;
arr[i]=ele;
}

}
T max()
{
T m = arr[0];
for (int i = 0; i < used_size; i++)
{
if (m<arr[i])
{
m = arr[i];
}

}
return m;
}

void search(int num)
{
for (int i = 0; i < used_size; i++)
{
if (arr[i]==num)
{
cout<<"The element is found in position "<<i<<endl;
}

}
}

void Insert(int i, int num);
void Append(T i)
{
if (used_size < total_size)
{
arr[used_size]=i;
}
else
cout<<"Append Not Possible..."<<endl;

}
};

template <class T>
void ADTArray<T> :: Insert(int i, int num)
{
if (used_size < total_size)
{
for (int j = used_size+1; j >i; j--)
{
arr[j]= arr[j-1];
}
arr[i]= num;
}
else
cout<<"Insertion Not Possible..."<<endl;

}
int main()
{
ADTArray<int> a;
int N, index, ele;
cout<<"Enter the value of N: ";
cin>>N;
a.setArray(N);
cout<<"Enter the index and get element: ";
cin>>index;
a.get(index);
cout<<"The largest value is: "<<a.max()<<endl;
cout<<"Enter the positon and the element to be inserted: ";
cin>>index>>ele;
a.Insert(index, ele);
a.display();
return 0;
}

NiteshSingh-mfrx
Автор

Hey random person seeing this comment have a nice day with best playlist of c tutorial and best tutor Harry bhai

yashvaibhavi
Автор

display, append and insertion operation in C using structures ->

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

struct array{
int* a;
int size;
int length;
};

void display(struct array arr)
{
printf("\nThe Elements are: ");

for(int i=0; i<arr.length; i++)
{
printf("%d ", arr.a[i]);
}
}

void append(struct array* arr, int x)
{
if(arr->length < arr->size)
{
arr->a[arr->length++] = x;
}
}

void insert(struct array* arr, int index, int x)
{
if(index >= 0 && index < arr->length)
{
for(int i=arr->length; i>index; i--)
{
arr->a[i] = arr->a[i-1];
}

arr->a[index] = x;
arr->length++;
}
}

int main()
{
struct array arr;

printf("Enter Size of an Array: ");
scanf("%d", &arr.size);

arr.a = (int*)malloc(sizeof(int) * arr.size);
arr.length = 0;

printf("\nEnter Number of Elements: ");
scanf("%d", &arr.length);

printf("\nEnter All Elements: ");
for(int i=0; i<arr.length; i++)
{
scanf("%d", &arr.a[i]);
}

display(arr);

append(&arr, 7);
display(arr);

insert(&arr, 2, 14);
display(arr);

printf("\n");

return 0;
}

codewithirfan
Автор

Very clear and understandable quality teaching

Harshit-igsv
Автор

a playlist on aptitude and reasoning for placement purpose.

utkarshgautam
Автор

This channel is gonna hit 5 million in a year !!
Let's see
Take love from Bangladesh Harry Bhai.
I am gonna complete each and every course of yours In sha Allah.
You are the only person whose videos never get boring no matter how long it is !

nafisahmed
Автор

Zip ko extract kiya pr wo open he nhi rha bhaiya 😅😅

harshsingh
Автор

20:29
Tried to write code
struct myArray{
int total_size;
int used_size;
int* max();
int* get(int i);
void* set(int i, int num);
}

shreyasethi
Автор

Sir if possible make playlist Mongo DB, NodeJS, ExpressJS, Angular, React.

dineshbhol
Автор

>>> Bhai "c++" ka cource complete hogaya ?
Aur
>>> Ek playlist "c" ya "c++" ki problems aur uski challenges pe bnaeye taki ham practice kar sake.
>>> And thank you for uploading daily videos.
>>> Once again thank you.

mevishalcoder
Автор

Harry bhai iss playlist me ek or video add kro Fibonacci Search and Interpolation Search... khaaskar Fibonacci Search😑😑.., kahi bhi dhang ka content nahi pda or apke hote hue aisa nhi hona chahiye🙂😅😛 Hope you'll find my comment and soon upload it..!😎 raise your hands guys if want the video on Fibonacci Search and Interpolation Search🖐

ORitvikSardhyal
Автор

Hello bhai yek dikat aa rehai hai C programming visual studio code m
Issue hai # include errors detected. Please update you're include path. Squiggles are disabled for this translation
Bhai is issue ko solve kar do pls

If you have read my message please give me a like and I will got to know that you will make a video on this issue
bhai jab m # include<studio.h> likh raha hu to to y issue as raha hai

paarthmalhotra
Автор

bhaiya hum log is tarah se to array ko resize kar sakte hai na pehle hum log array ke liye dynamically memory allocatte karenge fir, hum log is tarah se function ko build karegen ke pehle wo user se poochega ki user resize karna chahta hai ya nhi agar yes to phir simultaneously ek new array ko n+1 size ke saath dynamically declare karenge fir waha pe sare elements ko copy karnenge aur nye elements ko +1 index mei store kar denge fir purane wale array ke memory ko free kar denge. Fir original wale array ke naam se ek aur array dynamically create karenge aur uska size bhi n+1 rahega. Fir 2nd array se sare details is nye wale original array ke naam wale array mei copy kar denge. Fir 2nd wale array ko delete kar denge. Ha pata hai ki purana wala array resize nhi ho rha lekin ye sare details to abstracted rahenge to phir ye chiz user ko pata nhi chalega. Use to yhi lagega ki uska wala array hi resize ho ke usme ek nyi jagah add ho gyi. is tarah se kisi bhi position mein delete ya insertion kar lenge. Aur array ko resize bhi... aur sabki time complexity bhi order of n ke term mei ayegi. aur space completexity bhi original array ke respect mei hi hogi. bas ek nye element ka size bad jayega jo ki swabhavik hai.

letshavefuntogether
Автор

Harry sir jo syntax c me bta rhe ho vo c++ me bhi bata diya kro plss

SatyamSingh_
Автор

can someone please tell me that is it data structure using C ...Please help its urgent

sahilmishra
Автор

I tried many more times, bt I couldn't donload the notes.😟plzzz anyone can tell me, what's wrong 🙏

vidyatrimbake
Автор

Aek aesi playlist bnani chahiye jisme applitude, technical round sari placement process ki preparation kraye

ce-vinaysangal