Type: Posts; User: razzle
Search took 0.02 seconds.
One way would be to use the median finding algorithm to split the array into two equal halves and then reorder it so that all elements smaller than the median go into the left partition and the rest...
Okay, I must admit your professor is right.
It's this line that makes the difference,
Assume you call Function with N. Then the innermost for loop will iterate N^2 times the first time...
January 23rd, 2015, 06:22 PM
Iterators aren't just C++.
They are one of the basic OO Design Patterns:
"Provide a way to access the elements of an aggregate object sequentially without exposing its underlying...
January 23rd, 2015, 12:26 PM
Are you sure about that?
To me it rather looks like O(log N) and then some but not much.
January 21st, 2015, 11:52 PM
Well, at one point not very long ago even native C++ was declared irrelevant. :)
I think MFC may be experiencing something of a revival by being included in the VS 2013 Community and thus...
January 21st, 2015, 07:29 AM
Well, your problem is special in that the graph is complete (every vertex is connected with every other vertex) and that the edge lengths are interdependent (because of the way they are constructed...
January 21st, 2015, 02:42 AM
I'd say the GUI subsystem closest to Windows Forms for native C++ would be Microsoft Foundation Classes (MFC). It's included in the free Visual Studio 2013 Community Edition.
Using MFC will make...
January 20th, 2015, 04:23 PM
Your problem can be re-formulated as an equivalent graph problem.
Each of your numbers is represented by a vertex in a graph. All vertexes are connected by edges forming a complete graph. The...
January 20th, 2015, 05:56 AM
The question was whether a single .h always can be made functionally equivalent to a .h/.cpp split using any means such as inlining, templating, #include guarding, local statics, etcetera.
January 20th, 2015, 02:49 AM
You've claimed this before and I've addressed it already, mainly in posts #16 and #17.
In a nutshell: Good design reduces complexities and interdependencies of programs. In addition to making them...
January 20th, 2015, 02:38 AM
I don't follow you.
Lets say you make a .h/.cpp split in order for the .h file to be used in several TUs.
Now, isn't it possible to reverse the .h/.cpp split and put everything together again...
January 19th, 2015, 05:41 AM
Well, I don't have time to get too involved so I prefer to discuss in public. Then also you reach more people and get better help. :)
January 18th, 2015, 05:22 PM
I haven't experienced any limitations in particular. Okay some things must be done differently but the end result has always been better code. For example global data must be turned into Singletons...
January 18th, 2015, 04:54 PM
So in your view the main advantage of .h/.cpp splitting is that if you're lucky ODR related problems may not surface?
Isn't it better to know C++ to the extent that you can write programs...
January 18th, 2015, 03:42 PM
Well, before you do that I advice you to first improve your argumentation skills considerably.
No offence but there's a difference. I've argued my case whereas the only thing you've come up with...
January 18th, 2015, 09:28 AM
Coming from Java I've always found this obsession with .h/.cpp kind of weird. It has no design benefits and regardless of how you split a program the tool chain responsible for producing an...
January 18th, 2015, 06:47 AM
You have lots of education already and now is the time to put what you already know to practical use.
As I see it you don't have any spare time until you're considered the best among peers and the...
January 18th, 2015, 05:13 AM
Well, topogically you're on a torus and since a torus can be view as two circles and they're equal in this case because the grid is square, I guess you can speak of a diameter.
Your grid has so...
January 18th, 2015, 03:51 AM
It's usually called a torus grid (lattice) because topologically you're on a torus (donut).
If the distance from a node to any of its 8 neighbors is 1 it's called a Chebychev distance (rather that...
January 16th, 2015, 01:03 AM
Well in that case you don't collect ALL "name/family" combinations into the dynamic array. You only put in the "name/family" combinations from the families the "individuals" are interested in. Pretty...
January 15th, 2015, 12:33 PM
I have deduced the average cases and given the O complexity in previous posts.
The average number of steps between any A and any B in the unidirectional and bidirectional cases are 2N/3 and N/3...
January 15th, 2015, 08:09 AM
Well, in my replies I've defined N to mean the side length of the grid (N=8 in your example). It seemed most natural to me but of course you can use the total number of elements instead. Then your N...
January 15th, 2015, 05:34 AM
With "structured and organized in specific manner" I assume you mean what I decribe at the beginning of my previous reply? Otherwise all bets are off.
I have given the average number of steps for...
January 15th, 2015, 03:06 AM
You are wrong.
The term immutability is not even mentioned in the standard. Immutable is mentioned once but then in the genereral computer science meaning of the word.
C++ has a language...
January 13th, 2015, 09:49 AM
I understand that .h/.cpp splitting has a long history and that probably explains why it's so deeply rooted today. But maybe the time has come to reconsider this practice?
I started putting more...
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.