Count number of strings with given prefix

preview_player
Показать описание
This video explains how to find the number of strings having a given prefix. There are many methods to solve this but one of the most efficient approach has been explained in this video which is by using trie data structure. CODE LINK is given below. If you find any difficulty or have any query then do COMMENT below. PLEASE help our channel by SUBSCRIBING and LIKE our video if you found it helpful...CYA :)

Рекомендации по теме
Комментарии
Автор

sir loving your approach, code, explanation and personality..

kheersagarpatel
Автор

Hey, Thank you so much all your knowledge sharing. I am able to perform very nice in all my interviews. Keep up the good work. More power to you.
Keep rocking!!!

ravitiwari
Автор

@TECH Clear and concise explanation!
In the question instead of just the a-z, if it says that nodes would contain A-Z, a-z, 0-9, special characters, in such case :
1. How should we construct the children array[26]
2. What would be the base from which we construct the array. I mean, similar to 'c'-'a' that we used in the above problem, what should we do in the case of a wider range of values like this A-Z, a-z, 0-9, special characters

srikrishnarohanmadiraju
Автор

Bhai aisa smghaya hota hai na apne ki aadha video dekhte dekhte khud hi pura code likh dete hai 🙌❤️

animeshrajput
Автор

Sir, your explanation is very clear.i got the concept within just 5 min but sir its my humble request to you plz explain the code part also if possible .because it will be really helpful for beginners like me

ashvinimeshram
Автор

Please explain code too!
Your content is really beneficial.
Need some personal tips, please do let me know the platform to connect with you.
Thank You Sir

abhishekgautam
Автор

Hello! Thanks for your video. Can you tell me how counting the number of repeating words in a trie

catded
Автор

It will be better if you explain code part explanation part is great👌

rahulagarwal
Автор

i have seen your code and why u have used this curr->child[index]->wc ===0 as wc be incremented when it is a end not every time right??

gouthamreddy
Автор

this is the same as the FP growth algorithm in ML right?

rjadhav
Автор

How to print those strings too?
please help

shubhamjain
Автор

Hi, this diagram looks like a binary tree. Can I use a binary tree to do this prefix test?

badrulhussain
Автор

Hi.
Trienode *getNode(char c)

{

Trienode *newnode = &nodepool[poolcount++];

newnode->data = c;

for(register int i=0;i<26;++i)

newnode->child[i] = NULL;

newnode->wc=0;

return newnode;

}

Here, newnod->wc=1??
Should it not be equal to 1, because in delete and search we are checking that if wc is 0, then we are returning false. Please let me know.

deviverma
welcome to shbcf.ru