Data structures using Cpp
When my son told me that no one uses "C" nowadays, I realized my
folly. I am writing an app, working my heads off, searching questions
and solving them for an app which has lot of competition and may not
find many users.
But writing all those 130 programs in C++ will take another year. (Yes I "have" written around 130 programs). It should not take another year, but you know me.
So I have come to this conclusion. Before I release the app, I will implement basic structures - LL, stack, queue and BT in C++. And I will also try to add another 30 more programs in C++. That is - versions of programs in C++ for which C programs already exist.
I see two advantages here - for the app user. a) he/she will be able to write DS programs in shorter and more compact and intuitive way. b) he/she will become more familiar with C++ language.
What better example do we get for encapsulation (keep your head and append and delete and display functions inside of the class), data hiding - private and public (head - what head are you talking about? You can only access the list. How we implement append, insert, delete or display is of no concern to you).
And for once, the reader will be happy to write a C++ program instead of C. Because there is no need to return head pointers, no need to use double pointers and no need to worry if the function modifies more than one parameter.
So I will post these C++ programs in my data structures blog. Happy DSing!
P.S. If you have not noticed already, all my data structure programs will be available in Data structures blog instead of C with Linux .
But writing all those 130 programs in C++ will take another year. (Yes I "have" written around 130 programs). It should not take another year, but you know me.
So I have come to this conclusion. Before I release the app, I will implement basic structures - LL, stack, queue and BT in C++. And I will also try to add another 30 more programs in C++. That is - versions of programs in C++ for which C programs already exist.
I see two advantages here - for the app user. a) he/she will be able to write DS programs in shorter and more compact and intuitive way. b) he/she will become more familiar with C++ language.
What better example do we get for encapsulation (keep your head and append and delete and display functions inside of the class), data hiding - private and public (head - what head are you talking about? You can only access the list. How we implement append, insert, delete or display is of no concern to you).
And for once, the reader will be happy to write a C++ program instead of C. Because there is no need to return head pointers, no need to use double pointers and no need to worry if the function modifies more than one parameter.
So I will post these C++ programs in my data structures blog. Happy DSing!
P.S. If you have not noticed already, all my data structure programs will be available in Data structures blog instead of C with Linux .
Comments
Post a Comment