How to Print in Lexicographical Order using Recursion?? | Algorithms
ฝัง
- เผยแพร่เมื่อ 26 ก.ย. 2024
- Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we explain about Lexicographical order or the order in which words are present in the dictionary. With this, we present the problem where we are required to print numbers in a lexicographical manner and discuss the solution using Recursion and Euler Tree.
.....................................................................................................................................................................
Pepcoding has taken the initiative to provide counselling and learning resources to all curious, skilful and dedicated Indian coders. This video is part of the series to impart industry-level web development and programming skills in the community.
For better experience and well organised free resources visit -
We also provide professional courses with live classes and placement opportunities.
DSA Level 1 and Level 2
www.youtube.co...
Webinar on GATE Preparation
• Video
Here is a roadmap to our Free study content and know more about our resources here - www.pepcoding....
We are also available on the following social media platforms: -
Facebook(Meta) - / pepcoding
Instagram - / pepcoding
LinkedIn - / pepc. .
Pinterest - / _c. .
Twitter - / pepcoding
TH-cam (English Channel)- / @pepcodingprogrammingi...
Also take a look at our placement assistance - www.pepcoding....
HAPPY PROGRAMMING!
Pep it up.....
Hashtags
#pepcoding #recursion #lexicographicalorder
This is the exact code I came up with after seeing the question part of the video, Although it took me an hour, Thank you so much sir.. aapke series ko foundation se follow krta aarha hu.. ab dimag ki taarein judne lagi h..😂 sab aapke wajah se hi possible ho paaya h.. ab toh shukriya bhi chhota word lgta h aapko bolne ke liye.. you're damn awesome teacher..
The man who teach too good
Recursive leap of faith is very important in problem solving!
No one can beat you sir.Huge respect for you for providing these content.
Your explanations are always best!
Gajab level up questions are really intuitive
If u still want to improve run time of the solution check wether it(10*i+j) exceeds n inside for loop itself :
literally, i saw this video in normal speed because of your explanation
it's super
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
Sir can u make a video on how to remain motivated on on-campus tests after getting rejections in some starting companies :)
Yes, will do one soon
Sir logic shi socha tha ekdum bas code ke syntax bas dekhna pda thoda sa nhi to sara khud se ben gya best qustion form level1 to levelup so sir mja aa gya bole to
Koi dikkat nh beta, keep it up!
maza aaya..seekhne main.. :) Thank you bhaiya
I am glad
Sir ji, plz include the time and space complexity too. Its always asked in interviews. Thanks
n to power n
@@anjneykumarsingh4461 O(n) hai
This concept is something we will never forget :), whats the time and space complexity ?
O (n). Har number ek baar he visit hua hai
space complexity should be O(L) where L is number of digits in the number
@@Pepcoding pr stack frame jo bana hai uska space nahi count hoga kya ??
Sir if possible please do discuss time complexity too.Please
very interesting problem
Can someone explain how time complexity of this is O(n)..
sir for "n = 13" it gives wrong output!
Sir bhot acha kaam kr rhe ho
Thank you
really good stuff
Glad you think so!
great explanation!
Wow!
You should write a book on DSA
Thankyou beta!
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
awesome sir
Tq
thank sir no one clearly explained what is lexicograpghical order
The initial 4 minutes only made the solution clear ..... awesome
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
Mast tha ❤️
Glad you love the explanation, For better experience and well organised content sign up on nados.io and start learning.
till 04:10, i got the approach and was able to code it up myself later
Great!
Keep going.
And for better experience, visit nados.io, where you will get well curated content and career opportunities.
How to print String in lexicographical Order?
Such a clear explanation.... Many thanks to you :)
class Solution {
public:
vector res;
void dfs(int num,int n){
if(num>n) return;
for(int i=0;i
For better experience and well curated content sign up on nados.io and keep learning.
sir is this a part of levelup ?
Yes
Hello sir..
Sir mujhe bas C language ata hai
Or java bilkul nahi ata hai..
To sir java foundation course Karu
Ya fir pahele java basic kahi or resource se learn karu and then apka java foundation course and then levelup karu..
Please sir guide me
beta pehle 5 lectures yahan se karlo, java aa jaegi.
www.pepcoding.com/resources/online-java-foundation
2 din lagenge sirf
@@Pepcoding thank you sir 😊
Bhai mai bhi c k through ds krra tha ab chod di sir n jaise ds through java pdhai h you will fall in love , recursion❤
@@anjneykumarsingh4461 thanks dude.. 👍
Sir please iske sath parallely Arrays and String start kar dijiye, uske tricky questions mein dikkat aa rhi hai
beta, bhot stress ho rha hai. bache calls jyada kar rhe hain. Uthani bhi jaroori hai. Uski wajah se mai target miss kar rha hun. Agar time mile to 5 iski, 5 uski bna doon
@@Pepcoding Sir specified time pr lia kro na calls vrna overtime wear out hojaoge fr lagega galat mussebat galle pdgyi , fr pta chle nahi video bana ne ka mann kre, nahi calls lene ka :-)
This question seems like from levelup.
Thank you
sir to phir 002 100 se pehle aana chahiye na
Hope you like the explanation.
Visit - nados.pepcoding.com and sign up to NADOS.
Also you can ask your doubts on community tab. There are lots of programmers and mentors who can help you out with such doubts.
Don't forget to follow us on Instagram instagram.com/pepcoding/
What is dfs?
Depth first search. Level1 ke graphs kijie pehle.
one thing i unserstand is faith is very important hahahah
Time complexity = O(n) ?
Coz each number is traversed once🙄🙄
yes
I am still watching and learning from this channel.
But you guys stop creating content on the channel.🥲
New thumbnail on Video...
Nice channel to follow...
Thanks and welcome
public static void helper(int curr,int n){
if(curr>n){
return;
}
System.out.println(curr);
helper(curr*10,n);
if(curr%10+1