Tutorial 7-Competitive Programming-Find The Time Complexity Of This Problem
Skills:
Algorithm Basics90%
Key Takeaways
Analyzes the time complexity of a given problem statement in competitive programming
Full Transcript
hello all my name is krishnak and welcome to my youtube channel so guys this is the next tutorial of competitive programming along with data structures and algorithms and in this video we are going to discuss about a problem statement which is based on time complexity so many of you have actually given me a feedback saying that krish first tell give us the problem statement give us some time around five to six hours then we'll try to solve it we'll try to provide that particular comment in this specific video and then you try to provide the solution so considering this i am starting with this particular thing guys here first of all i'm going to discuss about the problem statement after discussing about the problem statement the next video will be the solution of this particular problem statement okay so in this video we are going to find out what is the time complexity of this particular function so here is a function which i have defined as def func with n value over here then i write for i in range 1 comma n this is a for loop first for loop n value can be anything whatever you want to specify then j is equal to i i is basically getting assigned to j then again i have an internal loop which says that while j is less than i multiplied by i then j is equal to j plus i if j modulus i double equal to 0 for k in again another loop after the if condition for loop is again there which is iterating between 0 to j and then i'm printing crash okay now this particular problem statement if i write funk of 1 so here you can see that nothing is getting printed if i write funk of 2 i think ok nothing is getting printed over here again if i write funk of three over here four krishnas get imprinted if i write funk of four this many krish is getting printed now the main problem is that you need to find out what is the time complexity i've already shown you whenever we ask what is the time complexity you should basically be getting your worst case or the best case you know what is the time complexity but in this example i want the worst case of this particular time complexity and for this i have also given an options over here capital o basically denotes the big o notation which is nothing but the worst case for this particular problem statement with respect to the time complexity the first option is worst case o a bigger notation of n cube second option is bigger notation of n square third option is big o notation of n to the power of five and the fourth option is big o notation of n multiplied by n minus one remember this is the worst case so you have to tell me that out of this all option which is the exact right option you can tell me and you can let me know about it again remember we are talking about the worst case okay try to do with different different n values you will definitely be able to get the solution okay please try it out again this is the pattern that i'm going to follow with respect to all the other videos that are going to come up with in competitive programming this is a very very simple function right now in the later stages i will be creating more complex functions there will be so many conditions internally and you basically need to find out the time complexity uh with respect to the solution because this is also that is basically getting asked in data structures algorithm this kind of problems was asked to me when i had given uh interview in yahoo uh somewhere around 2013 okay uh this kind of questions were actually asked i could not clear the interview i went till second round in the third round um they asked too much extensive data structures and algorithms questions uh with respect to different kind of sorting techniques yeah sorting techniques i knew most of them but yes they were trying to you know drill down a lot of things from me so this kind of questions will definitely be helpful so just try it out from your side and uh in the next video probably after five to six hours i'll upload the solution for this right i'll explain you with my pen i'll try to write everything and then we'll try to understand it so i hope you like this particular video please make sure that you subscribe the channel and please do comment down the answer for me out of these four options and this particular notebook file will be uploaded in the github i'll see you all in the next video have a great day ahead thank you bye-bye
Original Description
github: https://github.com/krishnaik06/Competitive-Programming/blob/master/Problem%202-Time%20Complexity.ipynb
Competitive Programming Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVNtnMPq4XDnTFu38-bbp5F2
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for a few months and I love it! https://www.kite.com/get-kite/?utm_medium=referral&utm_source=youtube&utm_campaign=krishnaik&utm_content=description-only
Starter In Data Science
1 Complete Machine Learning Playlist:(Top 24 videos)
https://www.youtube.com/playlist?list=PLZoTAELRMXVPBTrWtJkn3wWQxZkmTXGwe
2 Statistics in Machine Learning:(Understand some Concepts With Respect To Data)- Complete Playlist
https://www.youtube.com/playlist?list=PLZoTAELRMXVMhVyr3Ri9IQ-t5QPBtxzJO
3. Feature Engineering(Complete Playlist)
https://www.youtube.com/playlist?list=PLZoTAELRMXVPwYGE2PXD3x0bfKnR0cJjN
4. Continue The Complete Machine Learning Playlist(24-all the videos)
5. Live Stream Playlist:(Top 10 videos)
https://www.youtube.com/playlist?list=PLZoTAELRMXVPUyxuK8AphGMuIJHTyuWna
6. Machine Learning Pipelines
https://www.youtube.com/playlist?list=PLZoTAELRMXVMcRQwR5_J8k9S7cffVFq_U
7. Complete Deep Learning Playlist:
Tensorflow And Keras-https://www.youtube.com/playlist?list=PLZoTAELRMXVPGU70ZGsckrMdr0FteeRUi
Pytorch: https://www.youtube.com/playlist?list=PLZoTAELRMXVNxYFq_9MuiUdn2YnlFqmMK
8. Live Projects Playlist:
https://www.youtube.com/playlist?list=PLZoTAELRMXVOFnfSwkB_uyr4FT-327noK
9. Live stream Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVPUyxuK8AphGMuIJHTyuWna
10.Docker Playlist: https://www.youtube.com/playlist?list=PLZoTAELRMXVNKtpy0U_Mx9N26w8n0hIbs
11. Mongodb: https://www.youtube.com/playlist?list=PLZoTAELRMXVN_8zzsevm1bm6G-plsiO1I
12. Machine Learning Interviews: https://www.youtube.com/pl
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from Krish Naik · Krish Naik · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Natural Language Processing|Stemming
Krish Naik
Natural Language Processing|BagofWords
Krish Naik
Gaussian distribution or Normal Distribution in statisctics
Krish Naik
Natural Language Processing|TF-IDF for Machine Learning| Text Prerocessing
Krish Naik
Log Normal Distribution in Statistics
Krish Naik
Covariance in Statistics
Krish Naik
Confusion matrix, Precision, Recall| Data Science Interview questions
Krish Naik
Tutorial 44-Balanced vs Imbalanced Dataset and how to handle Imbalanced Dataset
Krish Naik
Implementing a Spam classifier in python| Natural Language Processing
Krish Naik
Tutorial 11-Exploratory Data Analysis(EDA) of Titanic dataset
Krish Naik
Face Recognition using open CV and VGG 16 Transfer Learning
Krish Naik
Pedestrian Detection using OpenCV from Videos
Krish Naik
Face and Eye Detection from Videos using HAAR Cascade Classifier
Krish Naik
Reading, Writing and Displaying images with Opencv| OpenCV Tutorial
Krish Naik
OpenCV Installation | OpenCV tutorial
Krish Naik
Face and Eye Detection from Images using HAAR Cascade Classifier
Krish Naik
Car Detection using HAAR Cascade and Opencv from Videos.
Krish Naik
Using OpenFace for Face recognition in Keras
Krish Naik
OpenPose Tutorial with Tensorflow
Krish Naik
Multiple Linear Regression using python and sklearn
Krish Naik
Dimensional Reduction| Principal Component Analysis
Krish Naik
Movie Recommender System using Python
Krish Naik
TPR,FPR,FNR,TNR, Confusion Matrix
Krish Naik
Precision, Recall and F1-Score
Krish Naik
Artificial Neural Network for Customer's Exit Prediction from Bank
Krish Naik
GridSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
RandomizedSearchCV- Select the best hyperparameter for any Classification Model
Krish Naik
K Nearest Neighbor classification with Intuition and practical solution
Krish Naik
K Means Clustering Intuition
Krish Naik
Create custom Alexa Skill- Lambda function- Part2
Krish Naik
Hierarchical Clustering intuition
Krish Naik
Implement Transfer Learning with a generic Code Template
Krish Naik
Gender Classifier and Age Estimator using Resnet Convolution Neural Network
Krish Naik
Unlock Your Application With Your Face using OpenCV
Krish Naik
Draw rectangle from webcam and sketch process it on a live feed
Krish Naik
Complete Life Cycle of a Data Science Project
Krish Naik
How we can apply Machine Learning in Finance
Krish Naik
Deep Learning in Medical Science
Krish Naik
How to switch your career to Data Science.
Krish Naik
Linear Regression Mathematical Intuition
Krish Naik
Handle Categorical features using Python
Krish Naik
Machine Learning Algorithm- Which one to choose for your Problem?
Krish Naik
DBSCAN Clustering Easily Explained with Implementation
Krish Naik
Curse of Dimensionality Easily explained| Machine Learning
Krish Naik
Feature Selection Techniques Easily Explained | Machine Learning
Krish Naik
Tutorial 29-R square and Adjusted R square Clearly Explained| Machine Learning
Krish Naik
Cross Validation using sklearn and python | Machine Learning
Krish Naik
Handling Missing Data Easily Explained| Machine Learning
Krish Naik
Deploy Machine Learning Model using Flask
Krish Naik
Deployment of Deep Learning Model using Flask
Krish Naik
How to Visualize Multiple Linear Regression in python
Krish Naik
K Nearest Neighbour Easily Explained with Implementation
Krish Naik
Predicting Heart Disease using Machine Learning
Krish Naik
Predicting Lungs Disease using Deep Learning
Krish Naik
Stock Sentiment Analysis using News Headlines
Krish Naik
Random Forest(Bootstrap Aggregation) Easily Explained
Krish Naik
Voting Classifier(Hard Voting and Soft Voting Classifier)
Krish Naik
Credit Card Fraud Detection using Machine Learning from Kaggle
Krish Naik
Hyperparameter Optimization for Xgboost
Krish Naik
Tutorial 45-Handling imbalanced Dataset using python- Part 1
Krish Naik
More on: Algorithm Basics
View skill →Related Reads
📰
📰
📰
📰
Help Choosing Neural Network Architecture for Matrix Classification
Reddit r/deeplearning
How to Choose the Best Deep Learning Model for Medical Imaging
Medium · Deep Learning
Another Way to Read Neural Geometry
Medium · Data Science
Another Way to Read Neural Geometry
Medium · Deep Learning
🎓
Tutor Explanation
DeepCamp AI