So far I'm understanding hash tables a lot better now! I could care less about style points (as users mentioned below), I'm just trying to understand the basics of this concept! So thank you very much. Keep up the vids :)
Just a style issue: you shouldn't include the standard headers in both hash.cpp and hash.h. They are standard headers so it is safe to do this. But why not just leave the standard header includes in hash.h, and have hash.cpp and main.cpp include hash.h? Also, you added the includes outside of the PP directives used to make the header safe. Should probably keep the includes within them.
+David Salinas I too... It took me 3.5 or 4 of this 8 minute video b4 I realized, It probably wasn't going to help me do any refreshing. I can't fault the guy, but I probably wouldn't be posting videos on youtude with such a limited base of experience, to put it nicely.
Thanks a lot Sir! ....you had explained it in detail but i, have a confusion that you are using open addressing method or separate chaining method in it????.............................Kindly replay sir it will helps me a lot.......................
It annoyed me too! One thing you can do is install the Chrome Audio Equalizer extension "Ears: Bass Boost, EQ Any Audio!" and turn down the high pitch noises of the fan.
+chetan dalal its better and more professional to have header separate from each other. This is because of how big a program can get in its future and also many other reasons.
Haven't watched the later videos yet, so not sure how the final implementation turns out, but wouldn't having the evaluated hash value modulo the size be better than dividing it? Because once you go past 1000 (for a size 100 array) it will cause an index out of range error.
Good Evening I want to ask a quastion. this project .More specifically the construction of the hash table is with open address ??? Please if you can answear quickly . Thank you!
@Paul Programming : From where did you learn CPP from , can you recommend all the books and references and methods you used , im in a desperate need for those, help
Sohel Katchi Project set up is important for newbies and something that is often skipped. I'm glad he went through it. It's easy to skip content if you don't want to watch those two minutes.
You can think about IDE as a garage full of tools to help you work on your projects. Now, every garage is different. Some IDEs are made specifically for certain type of developments. ie: Android Studio helps you build Android apps fast but that does not mean you can not write/compile "Android" code in other ways and means. I hope this clarify the IDE concept.
if you accidentally use a function/method from another class or function #include using namespace std; struct string { const char* p; }; int main() { string x;// Error: ambiguous - which string is wanted? } The problem here is that when main() specifies string x;, the compiler's not sure whether the user-defined ::string or included std::string is wanted. Now imagine you take the top part of the program... lines 1 through 3 - up to and including the struct string... and put it into a header file which you then #include before main(). Nothing changes: you still have an error. So, just as for standalone programs, header files with using statements in them can cause trouble for other code that includes them, making some of their statements ambiguous. It can be a bigger pain though, as headers can be included - directly or indirectly - by arbitrarily huge amounts of dependent code, and... removing the using statement from the header, or a change to the contents of , or any other header affecting std:: ...might break code including the problematic header. Either problem may render dependent code uncompilable, and issues may not even be noticed until another compilation is attempted. Further, the person suffering due to the using statement may not have filesystem/code-repository permissions, corporate authority etc. to remove the using statement from the header, nor fix other affected client code. That said, if a header only has "using" inside a class or function, then there's no affect on code beyond that scope, so the potential impact of changes to std:: is dramatically reduced.
+Odile Sutsakhan Yes, if you have the xcode IDE you should be able t make a new project using the line tool command and from there select the language c++.
You should not open namespaces in header files because if someone inserts your header he might have name conflicts. For example you have in the std namespace the function "doSomething()", you unwrap the std namespace in your "theheader.h", someone implements a function called doSomething() in their application, than they decide to add features from your "theheader.h" function and because you unwrapped the std namespace, doSomething() from his application will conflict with std::doSomething()...
As above, if you use a namespace in a header, you're also applying that namespace to everything else in the documents that include it. That will inevitably cause conflicts.
can anybody tell me why is there main.cpp & hash.cpp? what is the use of it? can anyone provide me some source to understand this?why there is two .cpp files?
So far I'm understanding hash tables a lot better now! I could care less about style points (as users mentioned below), I'm just trying to understand the basics of this concept! So thank you very much. Keep up the vids :)
Skip to 4:20
and then skip to 6:31
you're welcome
developermatters I found that helpful. Thanks
+developermatters Yo thnx!
+developermatters You're the best
+developermatters Gracias mi amigo. Lol
thanks to u. y he repeated same thing over n over n OVER :D
Just a style issue: you shouldn't include the standard headers in both hash.cpp and hash.h. They are standard headers so it is safe to do this. But why not just leave the standard header includes in hash.h, and have hash.cpp and main.cpp include hash.h? Also, you added the includes outside of the PP directives used to make the header safe. Should probably keep the includes within them.
David Salinas Why are you watching such basic tutorial videos if you already know so much about programming in C++?
Touche' Just refreshing my knowledge/skills.
+David Salinas I too... It took me 3.5 or 4 of this 8 minute video b4 I realized, It probably wasn't going to help me do any refreshing. I can't fault the guy, but I probably wouldn't be posting videos on youtude with such a limited base of experience, to put it nicely.
Thanks a lot Sir! ....you had explained it in detail but i, have a confusion that you are using open addressing method or separate chaining method in it????.............................Kindly replay sir it will helps me a lot.......................
thanks for describing the architecture!
Your lectures are really useful, thank you!
Please, people, don't include outside of the include guards(#ifndef..., or #pragma once)...
Man, have you cleaned your Pc's fan lately? What is that noise D:?
It annoyed me too! One thing you can do is install the Chrome Audio Equalizer extension "Ears: Bass Boost, EQ Any Audio!" and turn down the high pitch noises of the fan.
i love you man, thanks!!!!!!
Hey Paul, Is it necessary to include same library files in hash.h and hash.cpp files?
Isnt it sufficient to include just hash.h file in .cpp file.
+chetan dalal its better and more professional to have header separate from each other. This is because of how big a program can get in its future and also many other reasons.
Good video.
You used a Separate Chaining or? I have to do my Project in Separate Chaining but i have no idea how it looks like? Thx
Im trying to learn hash tables in C , how different would it be ? or is it mostly the same?
Haven't watched the later videos yet, so not sure how the final implementation turns out, but wouldn't having the evaluated hash value modulo the size be better than dividing it? Because once you go past 1000 (for a size 100 array) it will cause an index out of range error.
Good Evening I want to ask a quastion. this project .More specifically the construction of the hash table is with open address ???
Please if you can answear quickly .
Thank you!
@Paul Programming : From where did you learn CPP from , can you recommend all the books and references and methods you used , im in a desperate need for those, help
THANK U SIR
What IDE are you using?
dude you wasted half the video just setting up the project.
Sohel Katchi Project set up is important for newbies and something that is often skipped. I'm glad he went through it. It's easy to skip content if you don't want to watch those two minutes.
What is IDE?
+Hasan ! integrated development environment
You can think about IDE as a garage full of tools to help you work on your projects. Now, every garage is different. Some IDEs are made specifically for certain type of developments. ie: Android Studio helps you build Android apps fast but that does not mean you can not write/compile "Android" code in other ways and means. I hope this clarify the IDE concept.
It's MPLAB X I think, the same style
you should not use std namespace in header files
kristoffer thomassen why?
if you accidentally use a function/method from another class or function
#include
using namespace std;
struct string { const char* p; };
int main()
{
string x;// Error: ambiguous - which string is wanted?
}
The problem here is that when main() specifies string x;, the compiler's not sure whether the user-defined ::string or included std::string is wanted.
Now imagine you take the top part of the program... lines 1 through 3 - up to and including the struct string... and put it into a header file which you then #include before main(). Nothing changes: you still have an error. So, just as for standalone programs, header files with using statements in them can cause trouble for other code that includes them, making some of their statements ambiguous.
It can be a bigger pain though, as headers can be included - directly or indirectly - by arbitrarily huge amounts of dependent code, and...
removing the using statement from the header, or
a change to the contents of , or any other header affecting std::
...might break code including the problematic header. Either problem may render dependent code uncompilable, and issues may not even be noticed until another compilation is attempted. Further, the person suffering due to the using statement may not have filesystem/code-repository permissions, corporate authority etc. to remove the using statement from the header, nor fix other affected client code.
That said, if a header only has "using" inside a class or function, then there's no affect on code beyond that scope, so the potential impact of changes to std:: is dramatically reduced.
Thanks you so much
which editor are you using?
I believe it is Netbeans.
will this process work on a Mac too?
+Odile Sutsakhan Yes, if you have the xcode IDE you should be able t make a new project using the line tool command and from there select the language c++.
my right ear died.
don't use "using namespace" in .h files......
can anyone suggest me some java book to learn syntax as I know all concepts of c++ including data structure.
Why shouldn't `using namespace std` be used in a header file?
You should not open namespaces in header files because if someone inserts your header he might have name conflicts. For example you have in the std namespace the function "doSomething()", you unwrap the std namespace in your "theheader.h", someone implements a function called doSomething() in their application, than they decide to add features from your "theheader.h" function and because you unwrapped the std namespace, doSomething() from his application will conflict with std::doSomething()...
As above, if you use a namespace in a header, you're also applying that namespace to everything else in the documents that include it. That will inevitably cause conflicts.
@@Wourghk if i decide to use namespace std, or any other namespace, should i just include it in specific cpp files?
you shouldn't include the same thing so many times
NetBeans
Can't type this stuff into Visual Studio 2017. Spits out too many errors !!and I only got to 6:25 without compilation!
For example VS2017 wont let me type #incluede"hash.h" in the main.cpp
What kind of compiler is this guy using?
Some machines are making noise
How do I do this with vectors instead of arrays?
with vectors, the implementation should be super similar. what is your road block specifically?
please how do i do this on linux?
+Mary Omoyele stackoverflow.com/questions/24109/c-ide-for-linux
can anybody tell me why is there main.cpp & hash.cpp? what is the use of it? can anyone provide me some source to understand this?why there is two .cpp files?
Varun Kamani It's a Class file
www.cplusplus.com/
You should not use "using namespace std" in a header file..... It is just bad practice as your users are now stuck in there.
Pinguim
useless :/