Posts
 
Reputation
Joined
Last Seen
Ranked #40
Strength to Increase Rep
+11
Strength to Decrease Rep
-2
91% Quality Score
Upvotes Received
181
Posts with Upvotes
129
Upvoting Members
69
Downvotes Received
13
Posts with Downvotes
11
Downvoting Members
9
102 Commented Posts
~261.66K People Reached
Favorite Tags
Member Avatar for killerqb

[QUOTE]what is the time cost of the actual re balancing of the tree[/QUOTE] It depends on how the algorithms are implemented, but ideally for insertion the cost of rebalancing is constant. Only one part of the tree will ever be out of balance and at most two rotations will bring …

Member Avatar for Herbert_3
0
476
Member Avatar for cutedipti

I never liked the term "Self Referential Structure" because it implies that objects of the structure always refer to themselves. A self referential structure is better called a recursive structure. If the pointer is not NULL, it points to another instance of the structure. The null pointer is a base …

Member Avatar for mungara
0
1K
Member Avatar for group256

[QUOTE=firstPerson;947801]There is also cout.width(...).[/QUOTE] [ICODE]cout.width()[/ICODE] is not sticky. You need to call it for every object that gets printed, so code like this will only right justify the first string: [code=cplusplus] cout.width(30); cout << "right justified\n" << "left justified\n"; [/code] To justify both strings, you need to split the output …

Member Avatar for niario
0
14K
Member Avatar for dombit
Member Avatar for ibrahimali88
0
102
Member Avatar for you2

jephthah's way is the safest and most portable once you fix the nonportable assumptions: [code=c] #include <stdio.h> #if __STDC_VERSION == 199901L #include <stdint.h> #else /* change to fit the compiler */ typedef unsigned char uint8_t; typedef unsigned long uint32_t; #endif #define IPV4 #if defined(IPV4) #define NBYTES 4 #elif defined(IPV6) #error …

Member Avatar for pj.david_rajesh
0
14K
Member Avatar for mfcdoubt

[QUOTE][CODE]temp1 *maintemp1;[/CODE][/QUOTE] temp1 is a template class. The error means exactly what it says, and you should add a template argument list. Maybe [ICODE]temp1<test3>[/ICODE]?

Member Avatar for huda_7978
0
3K
Member Avatar for mz_rigel

Base means the longest sequence of fundamental digits before reaching 10. 10 is not limited to the decimal counting system, it is used in other bases to mean one more than the base: Base 10, decimal: 0 1 2 3 4 5 6 7 8 9 10 Base 8, octal: …

Member Avatar for WaltP
0
1K
Member Avatar for kgz

[QUOTE]do you know any method in which to draw hearts all over the screen in C++?[/QUOTE] I sure do: [code] #include <iostream> int main() { for (int x = 0; x < 1000; ++x) std::cout << "<3"; } [/code] :D

Member Avatar for Fuseteam
1
5K
Member Avatar for Tom Gunn

CSV is more than just comma delimited fields. There are quoting and white space rules too. This is a short function as an example of a complete way to read CSV records line by line.

Member Avatar for moonlight01
2
356
Member Avatar for Gaiety

[QUOTE]i can't get how can i use that in a program .[/QUOTE] alloca() is used just like malloc(). The difference is how they work under the hood. [QUOTE]and what is the advantage of such a function.[/QUOTE] [LIST] [*]alloca() is faster because it just needs to adjust the stack pointer. malloc() …

Member Avatar for monishch
0
182
Member Avatar for Gaiety

[QUOTE]then it would be like if-else if internally.[/QUOTE] [QUOTE]but here it is given as it uses jump tables [/QUOTE] I think compilers commonly use jump tables for a tight range of cases and compares for wider ranges. This switch would probably use a jump table: [code] switch (condition) { case …

Member Avatar for lyfzopen
0
182
Member Avatar for chaithanyap

[QUOTE]readb has declared under public section but am unable to access that through the derived class object d. d.readb();//is ambiguous[/QUOTE] read() is ambiguous, readb() should not be. You created the [URL="http://en.wikipedia.org/wiki/Diamond_problem"]Diamond Problem[/URL] where the most derived class has two copies of the same base object. Virtual inheritance fixes this problem …

Member Avatar for Ezzaral
0
862
Member Avatar for cjjack88

[QUOTE]When i remove the root of the binary tree and I view the binary tree in In-Order Traversal, my program will stop running.[/QUOTE] Then you are not resetting the links the way they should be. Removing the root means replacing the root with either the inorder predecessor or successor. Something …

Member Avatar for troyduff281
0
3K
Member Avatar for Gaiety

Technically all you need is a stack to store the nodes needed to get back to the nearest root and traverse the other subtree. So the memory cost is O(logN), not O(N), because the size of the stack has at most as many nodes as [ICODE]height(tree)[/ICODE]. The only way I …

Member Avatar for jl.lakhnai
0
176
Member Avatar for sbhavan
Member Avatar for DoEds

[QUOTE]Can anyone give me some ideas on how to find the middle value between 3 numbers.?[/QUOTE] Assuming it is always 3 numbers, and what you want is the median value, here is a simple way. Find the maximum then the minimum and the one you didn't pick is the median. …

Member Avatar for krutarth
0
3K
Member Avatar for gretty

[QUOTE]Would anyone like to share their tips & tricks for debugging functions & whole programs in C++. [/QUOTE] Learn how your computer works! :) I found that understanding the machine and things at a lower level like assembly and how the OS manages programs/memory really helped my debugging. It also …

Member Avatar for Dingbats
0
152
Member Avatar for eliza2044
Member Avatar for Tom Gunn

The forum is buzzing with questions about tokenizing a C++ string. This is a short function that does it and returns a vector of the tokens. As an option, the delimiter string can represent either a multichar delimiter or a collection of single char delimiters: [code] // multichar delimiter == …

Member Avatar for daviddoria
1
733
Member Avatar for serkan sendur

[QUOTE]if i compare number of his posts or reputation points or solved threads, i think Ramy or Scott(sknake) must be granted these before than him.[/QUOTE] If the criteria for being featured are post count, solved thread count, and reputation points then there are a lot of people in line before …

Member Avatar for jephthah
1
362
Member Avatar for alvalany
Member Avatar for kikat

Does your AvlNode class have a public default constructor, public destructor, and public assignment operator? Those are the requirements for storage in a container class.

Member Avatar for mrnutty
0
114
Member Avatar for job2617

[QUOTE] *Implementation of the Traveling Salesman Algorithm on Networking Systems. *Graph Traversal System Using Best Path Method . *Analysis on the Different Advanced Algorithms *Implementation of the Closest Pair Algorithm on Networking Systems *Comparative Study on the Efficiency of Sorting Algorithms[/QUOTE] These have been done to death. If you are …

Member Avatar for Nick Evan
0
977
Member Avatar for Dave Sinkula

[QUOTE]Newbies not using code tags are a huge issue for us, and we finally made some successful progress[/QUOTE] It must have been a sad state of affairs before that progress, because almost none of the new members use code tags in the C and C++ forums now.

Member Avatar for ablitz
4
348
Member Avatar for CrazyProgrammer

The algorithm is the same as with a binary tree. The only difference is you loop through the vector to find a matching key and then loop through the links and recursively traverse each one in turn.

Member Avatar for john.double
0
209
Member Avatar for siggivara

Typically the two options for a case like this are a count argument and a sentinel argument: [code] #include <stdio.h> #include <stdarg.h> /* gets a count of arguments */ void TestCount(int x, int n, ...) { va_list args; va_start(args, n); printf("%d: ", x); while (--n >= 0) printf("%-3d", va_arg(args, int)); …

Member Avatar for siggivara
0
182
Member Avatar for stevenpetersen

What do you mean by a points system? The whole idea is pretty vague.

Member Avatar for stevenpetersen
0
534
Member Avatar for candoc

You do need to do an fseek to that location, but not because C uses separate read and write pointers. The standard says that when switching between read and write mode on a stream, there needs to be a flush or seek between them. So you would read to the …

Member Avatar for Tom Gunn
0
112
Member Avatar for BitFarmer

[QUOTE]..or may be I am missing some option, in witch case, it should be a lot more visible than it is... I couldn't find it ;-) [/QUOTE] I can go to the Delphi forum, then under the Related Forum Features box on the right there is a direct link to …

Member Avatar for BitFarmer
-1
178
Member Avatar for Iam3R

[QUOTE]can somebody explain the behaviour of the statement printf("%d");[/QUOTE] Undefined. In practice it will probably print whatever is next in the stack and potentially corrupt the rest of your program by moving the stack pointer in an unexpected way.

Member Avatar for Tom Gunn
0
110