- Видео 97
- Просмотров 17 315
Lucidd8
Индия
Добавлен 28 окт 2024
Welcome to my channel! I explain coding solutions to popular LeetCode problems in Hindi, focusing on efficient problem-solving techniques using C++. Whether you're a beginner or an advanced coder, you’ll find clear, step-by-step breakdowns of algorithms and data structures to help you master each topic. Subscribe for more coding tutorials, tips, and tricks to boost your problem-solving skills!
Master coding with clear, concise solutions in Hindi!
Master coding with clear, concise solutions in Hindi!
Same Tree - C++ Solution Explained In Hindi
Welcome to my channel! In this video, we’ll solve the "Same Tree" problem using C++. This is a fundamental LeetCode question that helps you understand tree structure comparison and recursive problem-solving, commonly tested in coding interviews.
We’ll break down the problem statement, explain a recursive approach to determine if two trees are the same, analyze time and space complexity, and provide a detailed C++ solution. Whether you're preparing for interviews or honing your skills in recursion, this video is for you!
Topics Covered:
Problem Understanding
Recursive Approach for Tree Comparison
Base Cases and Edge Cases Explained
C++ Code Example
Time and Space Complexity Analysis
Tips for Codin...
We’ll break down the problem statement, explain a recursive approach to determine if two trees are the same, analyze time and space complexity, and provide a detailed C++ solution. Whether you're preparing for interviews or honing your skills in recursion, this video is for you!
Topics Covered:
Problem Understanding
Recursive Approach for Tree Comparison
Base Cases and Edge Cases Explained
C++ Code Example
Time and Space Complexity Analysis
Tips for Codin...
Просмотров: 20
Видео
Lecture 13 - Convert CFG to GNF Explained | UNIT - 3 | SPPU | TOC SERIES
Просмотров 41328 дней назад
In this lecture, we focus on converting a Context-Free Grammar (CFG) into Greibach Normal Form (GNF). This transformation is a crucial step in computational theory, simplifying grammar to ensure that every production starts with a terminal symbol, aiding in parsing and language processing. 🌟 What You'll Learn: The definition and properties of Greibach Normal Form (GNF) The step-by-step procedur...
Lecture 20 - Design Turing Machine For 2's Complement | UNIT-5 | SPPU | TOC SERIES
Просмотров 615Месяц назад
In this lecture, we explore the design of a Turing Machine to compute the 2's complement of a binary string. This builds on the concept of the 1's complement by adding a binary 1 to the least significant bit. This topic showcases the Turing Machine's ability to handle arithmetic-like operations. 🌟 What You'll Learn: The concept and significance of 2's complement in binary arithmetic Step-by-ste...
Lecture 19 - Design Turing Machine For 1's Complement | UNIT-5 | SPPU | TOC SERIES
Просмотров 258Месяц назад
In this lecture, we design a Turing Machine to compute the 1's complement of a binary string, where every 1 in the input is flipped to 0, and every 0 is flipped to 1. This problem illustrates the application of Turing Machines for simple data manipulation tasks. 🌟 What You'll Learn: The concept of 1's complement in binary systems Step-by-step design of a Turing Machine to transform a binary str...
Lecture 18 - Design Turing Machine For Language WcW | UNIT-5 | SPPU | TOC SERIES
Просмотров 210Месяц назад
In this lecture, we focus on designing a Turing Machine to recognize the language WcW WcW, where the string consists of a word W, followed by the character c, and then the same word W in the same order. This highlights the Turing Machine's ability to verify symmetry and patterns in strings. 🌟 What You'll Learn: Understanding the structure of the language WcW Designing a Turing Machine to compar...
Lecture 17 - Design Turing Machine That Accepts string with equal a's and b's|UNIT-5|SPPU|TOC SERIES
Просмотров 184Месяц назад
In this lecture, we design a Turing Machine that accepts strings containing an equal number of a's and b's, regardless of their order. This problem highlights the capabilities of Turing Machines to manage counting and balance checks in strings. 🌟 What You'll Learn: How to construct a Turing Machine to verify strings with equal a's and b's State transitions for pairing and eliminating characters...
Lecture 16 - Design Turing Machine For All Palindrome | Odd And Even | UNIT-5 | SPPU | TOC SERIES
Просмотров 163Месяц назад
In this lecture, we tackle the comprehensive task of designing a Turing Machine to recognize and accept all palindromes, whether of odd or even length. This is a significant step in automata theory, showcasing how Turing Machines handle symmetry and adapt to varying string lengths. 🌟 What You'll Learn: How to design a Turing Machine for recognizing both odd-length and even-length palindromes Un...
Lecture 15 - Design Turing Machine For Even Palindrome | UNIT-5 | SPPU | TOC SERIES
Просмотров 146Месяц назад
In this lecture, we design a Turing Machine to recognize and accept even-length palindromes, where the string reads the same forwards and backwards, with an even number of characters. This is an essential concept in automata theory, focusing on how Turing Machines can be used for detecting symmetrical patterns in strings. 🌟 What You'll Learn: How to design a Turing Machine to recognize even-len...
Lecture 14 - Design Turing Machine For Odd Palindrome | UNIT-5 | SPPU | TOC SERIES
Просмотров 152Месяц назад
In this lecture, we design a Turing Machine to recognize and accept odd-length palindromes, where the string reads the same forwards and backwards, with an odd number of characters. This is a crucial concept in automata theory, showcasing the power of Turing Machines to handle complex string patterns. 🌟 What You'll Learn: How to construct a Turing Machine for recognizing odd-length palindromes ...
Lecture 13 -Design Turing Machine To Accept Language Containing Substring 001|UNIT-5|SPPU|TOC SERIES
Просмотров 578Месяц назад
In this lecture, we focus on designing a Turing Machine that accepts a language containing the substring "001". This example demonstrates how Turing Machines can be used to detect specific substrings within a string, an important concept in pattern recognition and string manipulation. 🌟 What You'll Learn: How to design a Turing Machine to accept strings containing "001" Developing state transit...
Lecture 12 - Design Turing Machine For R = (aba*b) | UNIT - 5 | SPPU|TOC SERIES
Просмотров 839Месяц назад
In this lecture, we design a Turing Machine to recognize the language defined by the regular expression R = (aba*b), which consists of strings starting with "ab", followed by zero or more "a"s, and ending with a "b". This is a practical example of how Turing Machines can handle specific string patterns defined by regular expressions. 🌟 What You'll Learn: How to construct a Turing Machine for th...
Lecture 11 - Design Turing Machine to check well formation of strings | UNIT - 5 | SPPU|TOC SERIES
Просмотров 502Месяц назад
In this lecture, we focus on designing a Turing Machine to verify the well-formation of strings based on specific rules, such as matching parentheses, proper nesting, or other structural constraints. This topic demonstrates how Turing Machines handle complex string validation tasks systematically. 🌟 What You'll Learn: How to design a Turing Machine to check well-formed strings Understanding wel...
Lecture 10 - Design Turing Machine which replaces substring 101 with 110| UNIT - 5 | SPPU|TOC SERIES
Просмотров 636Месяц назад
In this lecture, we design a Turing Machine that scans a string on its tape and replaces every occurrence of the substring "101" with "110". This example highlights how Turing Machines are used for string manipulation tasks. 🌟 What You'll Learn: How to construct a Turing Machine for substring replacement Developing state transitions to identify "101" and replace it with "110" Managing the tape ...
Lecture 9 - Design Turing Machine For Language ending with 10 | UNIT - 5 | SPPU | TOC SERIES
Просмотров 339Месяц назад
In this lecture, we focus on designing a Turing Machine to recognize strings that end with the substring "10". This topic demonstrates the ability of Turing Machines to process and identify specific patterns in strings effectively. 🌟 What You'll Learn: How to construct a Turing Machine to identify strings ending with "10" Designing transition functions to detect patterns while scanning the tape...
Lecture 8 - Design Turing Machine to Multiply 2 Unary Numbers | UNIT - 5 | SPPU | TOC SERIES
Просмотров 939Месяц назад
In this lecture, we design a Turing Machine to perform multiplication on two unary numbers, where numbers are expressed as repeated symbols (e.g., sequences of 1's). This problem illustrates the computational power of Turing Machines in executing arithmetic operations. 🌟 What You'll Learn: How to construct a Turing Machine for unary multiplication Logic and transitions for iteratively adding on...
Lecture 7 - Design Turing Machine to Add 2 Unary Numbers | UNIT - 5 | SPPU | TOC SERIES
Просмотров 323Месяц назад
Lecture 7 - Design Turing Machine to Add 2 Unary Numbers | UNIT - 5 | SPPU | TOC SERIES
Lecture 6 - Design Turing Machine to Subtract 2 Unary Numbers | UNIT - 5 | SPPU | TOC SERIES
Просмотров 451Месяц назад
Lecture 6 - Design Turing Machine to Subtract 2 Unary Numbers | UNIT - 5 | SPPU | TOC SERIES
Lecture 5 - Design Turing Machine For Language having even no. 0s and 1s | UNIT - 5 |SPPU|TOC SERIES
Просмотров 304Месяц назад
Lecture 5 - Design Turing Machine For Language having even no. 0s and 1s | UNIT - 5 |SPPU|TOC SERIES
Lecture 4 - Design Turing Machine For Language a^i b^j i is less than j|UNIT - 5 | SPPU | TOC SERIES
Просмотров 328Месяц назад
Lecture 4 - Design Turing Machine For Language a^i b^j i is less than j|UNIT - 5 | SPPU | TOC SERIES
Lecture 3 - Design Turing Machine For Language a^n b^n c^n | UNIT - 5 | SPPU | TOC SERIES
Просмотров 258Месяц назад
Lecture 3 - Design Turing Machine For Language a^n b^n c^n | UNIT - 5 | SPPU | TOC SERIES
Lecture 2 - Design Turing Machine For 0^n 1^n | UNIT - 5 | SPPU | TOC SERIES
Просмотров 331Месяц назад
Lecture 2 - Design Turing Machine For 0^n 1^n | UNIT - 5 | SPPU | TOC SERIES
Lecture 1 - Introduction to Turing Machine | UNIT - 5 | SPPU | TOC SERIES
Просмотров 454Месяц назад
Lecture 1 - Introduction to Turing Machine | UNIT - 5 | SPPU | TOC SERIES
Lecture 6 - CFL to CFG When w is a odd,even,odd or even length palindrome | UNIT - 3|SPPU|TOC SERIES
Просмотров 331Месяц назад
Lecture 6 - CFL to CFG When w is a odd,even,odd or even length palindrome | UNIT - 3|SPPU|TOC SERIES
Lecture 12 - Derivation and Derivation tree Explained| UNIT - 3|SPPU|TOC SERIES
Просмотров 201Месяц назад
Lecture 12 - Derivation and Derivation tree Explained| UNIT - 3|SPPU|TOC SERIES
Lecture 11 - Conversion of CFG into CNF Explained| UNIT - 3|SPPU|TOC SERIES
Просмотров 334Месяц назад
Lecture 11 - Conversion of CFG into CNF Explained| UNIT - 3|SPPU|TOC SERIES
Lecture 9 - Conversion of CFG to PDA Explained | UNIT - 4 |SPPU|TOC SERIES
Просмотров 462Месяц назад
Lecture 9 - Conversion of CFG to PDA Explained | UNIT - 4 |SPPU|TOC SERIES
Lecture 8 - a^n+m b^m c^n Push, Pop, Nop Operations Expalined| UNIT - 4|SPPU|TOC SERIES
Просмотров 184Месяц назад
Lecture 8 - a^n m b^m c^n Push, Pop, Nop Operations Expalined| UNIT - 4|SPPU|TOC SERIES
Lecture 7 - a^i b^j c^k i + j = k Push, Pop, Nop Operations Expalined| UNIT - 4|SPPU|TOC SERIES
Просмотров 144Месяц назад
Lecture 7 - a^i b^j c^k i j = k Push, Pop, Nop Operations Expalined| UNIT - 4|SPPU|TOC SERIES
Lecture 6 - WaW^r WbW^r odd palindrome Push, Pop, Nop Operations Expalined| UNIT - 4|SPPU|TOC SERIES
Просмотров 175Месяц назад
Lecture 6 - WaW^r WbW^r odd palindrome Push, Pop, Nop Operations Expalined| UNIT - 4|SPPU|TOC SERIES
Lecture 5 - WW^r Even palindrome Push, Pop, Nop Operations Expalined| UNIT - 4 | SPPU | TOC SERIES
Просмотров 189Месяц назад
Lecture 5 - WW^r Even palindrome Push, Pop, Nop Operations Expalined| UNIT - 4 | SPPU | TOC SERIES
Finally dsa series is back
Yup it is
❤
nice explanation
in exam if our turing machine logic is correct and machine is correctly drawn but the effectiveness of the machine isnt the baest possible i.e. more number of states were used than minimum possible, will it be considered? and if yes will we get full marks for the answer?
very nice, can you provide notes pdf? please. tomorrow 10 am exam
t.me/study_metarial_Engg/351/1538?single You can visit this channel for notes
Completely understood 😮
Bhai isse simple explanation main aaj tak nai dekha or samjh bhi Aya 😊
bro... you are best...!!!! respect!!!!!!!!!
Thanks✨
love you brother thanks a lot
Kuch bhi sikhata
I tried my best
thanks vhai
Bhai important questions bata do
t.me/study_metarial_Engg/351/1538?single Refer this for unit 3, 4, 5 seperated pyqs
Bhai imp de do
Sir please made video on urgent basis of question: Design a Turning Machine which replaces substring 110 by 101
feedback - jara dhire bolo while explaining you should explain rules first baki sb good he bhai best of luck
Thank you for your feedback
Sir please make video for this question Design a Turing machine to recognise an arbitrary string divisible by 4, given input(0,1,2)
bdiaa videos hai apki.... keep it up
Thank you
How we would know that which characters we have to push, which have to skip and which have to pop?
in the context of this question we can know that the starting a's and ending a's frequency is same for which the logic would be as same as a^n b^n as both this character has same frequency now for the middle character b the frequency of b depends on the value m and as it is at middle and after making sure we will have at least one b we will do the furthur process that is skipping b's and that is why pushing the initial a's then skipping the b's and poping a's will be the logic to design pda for this language the push pop and skip logic will be different for different problems
@Lucidd8 now I got it thanks!
aswm🤌
Hii, are you a college student? if yes, in which sem you are?
Yes, and currently i am in 5th semester
can we add this transition function: ( q1, b, b) = ( q1, epsilon)
No we can't as we are pushing all the occurrences of a's into the stack and then poping those a's when we read b and then change the state to q2 such that we will pop a's from the stack when we read c so we never pushed b into stack and hence we cannot add this transition function
thanks sir
If you liked it, please do share the video
Bhai playlist ko pls sequence se lagao Btw video acchi se samaj raha hai
Thanks for the feedback, sure we will do that
Underatted channel....
thanks could u complete rest of series faster too pls?
Some topics are remaining such as cyk algo and ambigous grammar which I won't be uploading videos of and also pda to cfg topic from unit 4.
how many videos will be there for unit 3 ?
Mostly one more on cfg to gnf
Sir please upload unit ,6
I won't be uploading unit 6
very helpful
Best explanation
Thanks mate
finally understood , thanks bro
My Pleasure
bro kab tak complete hoga full syllabus or unit 4...
Before 5th unit 3, 4, 5 ke videos aajayege
Thank you bhai for this video series ,plz upload all unit video sooner ..
vahi plan hai bhai
try to explain in english
It is a Hindi channel but in future i will try to explain in videos in English
❤
for student like me this video is must helpful thankyou bhai keep going god bless you with lots of love & successes
thank you bhai
If i want length of middle word, what syntax will run?
public class MiddleWordLength { public static void main(String[] args) { String sentence = "This is a sample sentence"; // Split the sentence into words String[] words = sentence.split(" "); // Find the middle word int middleIndex = words.length / 2; String middleWord = words[middleIndex]; // Get the length of the middle word int lengthOfMiddleWord = middleWord.length(); // Print the result System.out.println("Length of the middle word: " + lengthOfMiddleWord); } }
very nicely Explained bro..
Thank you 🙂
Nice
🤩🤩 you really inspire me to code plz do upload videos daily ..
Sure 😊
❤❤❤
👏🏼
class Solution { private: int h(int i, int j, vector<vector<int>>&dp){ if(i == 0 || j == 0) return 1; if(dp[i][j] != -1) return dp[i][j]; return dp[i][j] = h(i - 1, j, dp) + h(i, j - 1, dp); } public: int uniquePaths(int m, int n) { vector<vector<int>>dp(m + 1, vector<int>(n + 1, -1)); return h(m - 1, n - 1, dp); } }; OR class Solution { private: int h(int i, int j, int m, int n, vector<vector<int>>& dp) { if (i == m - 1 || j == n - 1) return 1; if (dp[i][j] != -1) return dp[i][j]; return dp[i][j] = h(i + 1, j, m, n, dp) + h(i, j + 1, m, n, dp); } public: int uniquePaths(int m, int n) { vector<vector<int>> dp(m + 1, vector<int>(n + 1, -1)); return h(0, 0, m, n, dp); } };
C++ : class Solution { public: bool rotateString(string s, string goal) { for(int i = 0;i < s.size();i++){ char c = s[0]; s.erase(0, 1); s.push_back(c); if(s == goal) return true; } return false; } }; JAVA : class Solution { public boolean rotateString(String s, String goal) { for (int i = 0; i < s.length(); i++) { char c = s.charAt(0); s = s.substring(1) + c; if (s.equals(goal)) { return true; } } return false; } } PYTHON : class Solution: def rotateString(self, s: str, goal: str) -> bool: for i in range(len(s)): s = s[1:] + s[0] if s == goal: return True return False
bhai ye har videos mai dala koro .. thanks for the code
@@shootxpro5404 okay bro dyan rakhunga
nicely explained bhai, do make more such videos
Thanks bhai aache se samjane ka try karta rahunga
We need such videos❤❤
Thank you man stay subscribed i will bring more such videos in future
Bahut sahi bhai daily dalte raho
Vahi plan hai bro and thank you it means a lot
There is a lot of room for improvement Keep it up and thanks ye video dekh kar aache se concept samaj aagaya
Thank You for the feedback i am trying to explain it better
❤🔥❤🔥❤🔥❤🔥
Thank You Bro