Data Structures and Algorithms Problems
techiedelight.com
Data Structures and Algorithms Problems
1–10 of 12 posts
Re: Data Structures and Algorithms Problems
#2The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language specific patterns, but when you advertise the site as a coding interview helper I think that the solution code should reflect that which should be written in an actual interview.
Re: Data Structures and Algorithms Problems
#3One nitpick (and this applies to almost every site of this genre, i.e. geeksforgeeks, hackerrank, etc.): The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language sp…
http://www.techiedelight.com/data-structures-and-algorithms-...
Re: Data Structures and Algorithms Problems
#4One nitpick (and this applies to almost every site of this genre, i.e. geeksforgeeks, hackerrank, etc.): The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language sp…
Re: Data Structures and Algorithms Problems
#5One nitpick (and this applies to almost every site of this genre, i.e. geeksforgeeks, hackerrank, etc.): The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language sp…
So you prefer to use std::array over C arrays?
What do you think std:array are?
Re: Data Structures and Algorithms Problems
#6Earlier quoted context omitted.
So you prefer to use std::array over C arrays?
std::vector What do you think std:array are?
So C array equivalent = std::array, not std::vector.
Re: Data Structures and Algorithms Problems
#7Earlier quoted context omitted.
So you prefer to use std::array over C arrays?
std::vector What do you think std:array are?
Re: Data Structures and Algorithms Problems
#8Earlier quoted context omitted.
std::vector What do you think std:array are?
std::array is stack allocated array with known size compile time. std::vector is dynamically allocated array (on heap). So C array equivalent = std::array, not std::vector.
Imitating C arrays with std::array is the perfect example of bastardized C/C++ code.
Re: Data Structures and Algorithms Problems
#9One nitpick (and this applies to almost every site of this genre, i.e. geeksforgeeks, hackerrank, etc.): The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language sp…
Or they've spent a lot of time in embedded systems development. Many of us write rather C-ish C++ because of the limitations of older compilers and the age of the code bases.
Re: Data Structures and Algorithms Problems
#10One nitpick (and this applies to almost every site of this genre, i.e. geeksforgeeks, hackerrank, etc.): The code listed as "C++" is essentially C with ostreams. If I were interviewing someone and they claimed to know C++, and then used "sizeof(A) / sizeof(A[0])" to get the size of an array, I'd question how much C++ they actually knew. I understand that the focus here is mainly on problem solving and not language sp…