Тёмный
No video :(

Check If A String Is A Palindrome | C++ Example 

Portfolio Courses
Подписаться 215 тыс.
Просмотров 31 тыс.
50% 1

An example of how to check whether a string is a palindrome or not using C+.+ Source code: github.com/por.... Check out www.portfolioc... to build a portfolio that will impress employers!

Опубликовано:

 

22 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 35   
@rupertzoone3512
@rupertzoone3512 Год назад
Clear and smooth explanation with good example.
@PortfolioCourses
@PortfolioCourses Год назад
Thank you for the kind feedback Rupert. :-)
@abugslife2461
@abugslife2461 Год назад
Very helpful! Thank you so much!
@88NA
@88NA Год назад
this example is very well explained. thank you.
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome, I'm glad you enjoyed it! :-)
@carsmiles4035
@carsmiles4035 9 месяцев назад
Thank you so much for going into details! It is extremely helpful!
@asthagothi7151
@asthagothi7151 7 месяцев назад
The only explanation i needed
@christosvrettos8257
@christosvrettos8257 Год назад
Great explanatory video!!
@PortfolioCourses
@PortfolioCourses Год назад
Thank you very much Christos, I'm glad you enjoyed it! :-)
@merveilleuxguiradoumadji290
@merveilleuxguiradoumadji290 2 года назад
thank you so much,that was very hard for me .
@PortfolioCourses
@PortfolioCourses 2 года назад
You're welcome Merveilleux! 😀
@rakshithgowdahc9250
@rakshithgowdahc9250 Год назад
here in if statement can u explain the indexing how we did it?? because if text length is 10-1-1==8,how we are comparing is it the correct way what I calculated
@PortfolioCourses
@PortfolioCourses Год назад
Great question Rakshith! Remember that i starts off at 0. So if the length is 10 then we get 10 - 1 - i which is 10 - 1 - 0 which is then 9. And that would mean we are comparing the element at index 0 with the element at index 9, which is exactly what we want because (due to zero-indexing) the last char in the string will be at index 9. :-)
@alexandrstrekalovskiy4083
@alexandrstrekalovskiy4083 Год назад
Many thanks for video!
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome Alexandr! :-)
@abdelhakmezenner2855
@abdelhakmezenner2855 2 года назад
damn that was in my last exam of c programming 😂 it was so hard for me .. but now its a little bit easier
@PortfolioCourses
@PortfolioCourses 2 года назад
I’m glad to hear this made it a bit easier Abdelhak! :-)
@alshaimaahassan3512
@alshaimaahassan3512 Год назад
Many thanks for video
@PortfolioCourses
@PortfolioCourses Год назад
You're welcome Alshaimaa! :-)
@waed5893
@waed5893 Год назад
Thank you for video 👏 But if you can make video to check if we can make number palindrome after swaping their digits.
@PortfolioCourses
@PortfolioCourses Год назад
Thank you for the video idea Waed, I will add that idea to my list of video ideas. :-)
@Victor-fl8ex
@Victor-fl8ex 2 года назад
Hey Kevin, could you do this exact examply but using stack allocation and vectors?
@PortfolioCourses
@PortfolioCourses 2 года назад
I'm not sure, maybe one day! 🙂
@fovv3783
@fovv3783 Год назад
couldn't you add another empty string, then with for loop from back add reversed text to this empty string and then check if they are equal? I mean it is working in c# and i am not sure if you can do this in c++.
@PortfolioCourses
@PortfolioCourses Год назад
Yes, it sounds like that approach would work too! :-)
@gokulakrishnan9141
@gokulakrishnan9141 Год назад
Love you sooo much man❤
@PortfolioCourses
@PortfolioCourses Год назад
Haha thanks, love you right back ❤️
@HowDoYouTurnThisOn_
@HowDoYouTurnThisOn_ 5 месяцев назад
which line of code checks if the two characters are the same?
@ryanthelove
@ryanthelove 5 месяцев назад
if (palindrome[i] != palindrome[palindrome.length() - i - 1])
@urishitapandita8447
@urishitapandita8447 2 года назад
why did the text.length got divided by 2?
@PortfolioCourses
@PortfolioCourses 2 года назад
Great question Urishita! 🙂 We want to compare the 1st element to the last element, the 2nd element to the 2nd last element and so on to see if all of the corresponding elements match. So we really only need our loop counter variable to go until the middle of the string. Once we reach the middle of the string, we will have compared the 1st element to the last, the 2nd element to the 2nd last element, and so on. We could go keep past the middle of the string, but we would just end up making the same comparisons again, so for example by the last run of the loop we would just e comparing the last element to the 1st element again. We save work by only checking up until the middle of the string as that is all that is required. 🙂
@urishitapandita8447
@urishitapandita8447 2 года назад
@@PortfolioCourses okayy thank youu so much for your reply
@PortfolioCourses
@PortfolioCourses 2 года назад
You’re welcome! :-)
@yodakash6284
@yodakash6284 8 месяцев назад
fake!!!!!!
@PortfolioCourses
@PortfolioCourses 8 месяцев назад
What? :-)
Далее
Singleton Design Pattern | C++ Example
13:24
Просмотров 14 тыс.
Новый фонарик в iPhone с iOS 18
00:49
Просмотров 512 тыс.
КТО ЛЮБИТ ГРИБЫ?? #shorts
00:24
Просмотров 1,1 млн
Check If A String Is A Palindrome | Python Example
9:01
Learn Any Programming Language In 3 Hours!
22:37
Просмотров 345 тыс.
how Google writes gorgeous C++
7:40
Просмотров 854 тыс.
Check If A Number Is Prime | C++ Example
8:29
Просмотров 18 тыс.
Premature Optimization
12:39
Просмотров 791 тыс.