6,741 Posted Topics

Member Avatar for newcristy

>i read some articles about a 2-3-4 top-down search tree on the >web, but when i tried to go deep into the problem i realise that >most of the information aren't detailed. Most descriptions of 2-3-4 trees aren't detailed because most of the time it's more practical to simply use …

Member Avatar for newcristy
0
185
Member Avatar for Jishnu

>Both these members have said contradictory things. No, they said the same thing in a different way. back() returns a reference to the value of the last item in the collection. end() returns an iterator to one past the last item in the collection.

Member Avatar for Jishnu
0
120
Member Avatar for ahmed_hossni

>borlandc++ 3.11 under windows vista home edition You might as well ask about the coal driven steam engine in your Ferrari while you're at it.

Member Avatar for ahmed_hossni
0
106
Member Avatar for its.romi

That program is actually quite awful. I doubt it would be helpful to anyone interested in learning proper C. On the plus side, the binary search tree code looks decent, though I wouldn't recommend recursive algorithms when they don't buy you anything.

Member Avatar for Narue
0
119
Member Avatar for Ruzhyo2000

>would this be possible using C++ Not standard C++. Do some research on the curses library if you want more control over the console.

Member Avatar for FireNet
0
75
Member Avatar for vanhelsing

Keep the list sorted at all times, then the smallest node is always the first. Finding the smallest is a constant operation for obvious reasons, and maintaining it is also a constant operation because insertion of a smaller node is constant as is deletion of the current smallest node. Otherwise …

Member Avatar for Salem
0
157
Member Avatar for moemoekaung

You know what the thesis is about and still can't think of a title?

Member Avatar for jwenting
0
66
Member Avatar for guy40az
Member Avatar for Ancient Dragon
0
101
Member Avatar for jacknight

[QUOTE]Why does (start+last)/2 work to calculate the midpoint while start+(last-start)/2 does?[/QUOTE] I assume you mean why does (start+last)/2 fail when start+(last-start)/2 succeeds? Most of the time it doesn't. Both calculations have the same result except when the addition of start and last would overflow. The second calculation avoids the overflow …

Member Avatar for Narue
0
147
Member Avatar for jsmith9990

jimm00.kl/jsmith9990/crys0011, don't you think that talking to yourself is silly and answering your own questions is somewhat counter-productive?

Member Avatar for Narue
0
108
Member Avatar for tweezers

>Um i dont know i posted this in the right place You did. >cold u help me out please If by "help" you mean "do it for me", no. If you really do mean "help" as in "I can do most of it, but I have some questions", we can …

Member Avatar for binoj_daniel
0
296
Member Avatar for Ancient Dragon

>also give a nice overview of how a member has replied and helped other people. That kind of gives oldtimers the shaft though. For those of us who had thousands of posts long before marking threads as solved was a feature, it would seem like we're less helpful than we …

Member Avatar for jbennet
0
242
Member Avatar for ashok1424

>use something like: fscanf(stdin,"%s", &test); Please don't do that. scanf (or fscanf with stdin) is best avoided for strings unless you know what you're doing. fgets is easier to get right for most people. If you still want to use scanf, at the very least you should provide a maximum …

Member Avatar for Nick Evan
0
103
Member Avatar for Junior89

AMD used to be inferior to Intel, but not so anymore. I would say that they're evenly matched these days. Of course, I don't overclock, so I can't help you there.

Member Avatar for webbo
0
679
Member Avatar for Dean_X

>All I got was, "your code is wrong." That's an exaggeration. You received help for figuring out what's wrong with your code as well as for helping us to help you more. Then you started whining about how we're pricks (probably because we didn't point out every single problem and …

Member Avatar for WaltP
0
178
Member Avatar for sara_84

If what you posted is what you're actually trying to compile, it's no surprise. No part of that code is valid.

Member Avatar for iamthwee
0
172
Member Avatar for k2k

Your code shouldn't even compile. >if(!isdigit(next)) next is a string, but isdigit expects an integer. >double x= atof(next); next is a string, but atof expects a pointer to const char. How about something more like this: [code=cplusplus] #include <iostream> #include <fstream> #include <cstring> #include <string> #include <cctype> #include <sstream> using …

Member Avatar for Lerner
0
99
Member Avatar for bugmenot

Right now your list consists only of nodes. If you want data that applies to the list as a whole, you should create a new structure that contains a list as well as that data: [code=c] struct node { char str[100]; // where the strings will be kept struct node …

Member Avatar for Narue
0
171
Member Avatar for Max_Payne

>cos( n1 ) n1 is an object of NumeroReal, but it doesn't support an implicit conversion to any of the types that cos expects. Perhaps you meant [ICODE]n1.cos()[/ICODE]? That should give you an interesting result too, but it's more likely to take you in the right direction than trying to …

Member Avatar for Max_Payne
0
124
Member Avatar for iaaan

It's somewhat difficult to tell you what's wrong with the code when we can't see the code. :icon_rolleyes:

Member Avatar for iaaan
0
101
Member Avatar for Tell Me

>I want to ask if there function in library of c++ to search word in file ?? No. You need to break it down into smaller operations like reading a file and searching a string for a word. Then you can do this: [code=cplusplus] std::ifstream in ( "myfile" ); if …

Member Avatar for Tell Me
0
263
Member Avatar for meekblood25

And? What's the problem? Presumably you're traversing both arrays to compare them and stopping when they're obviously different or at the end: [code=c] while ( a != NULL && b != NULL && a->data == b->data ) { a = a->next; b = b->next; } if ( a == NULL …

Member Avatar for Narue
0
63
Member Avatar for mattp123

It looks like the location and the robots are disconnected, so the first algorithm that comes to mind is a simple one: [code] for each robot from robots integer r := robot.row() integer c := robot.col() select grid[r][c] from case 'R': grid[r][c] := '2' case '2': grid[r][c] := '3' case …

Member Avatar for Lerner
0
81
Member Avatar for driplet

A space character is ' ' and a tab character is '\t'. But you also have a problem with how you're doing the comparison: >if (CR == " " || CR == " ") Because you're using strcpy to fill CR, I can only assume that it's a C-style string. …

Member Avatar for Narue
0
4K
Member Avatar for DemonSpeeding

To delete any node from a single linked list you have the average case and one edge case. The average case is easy: loop through the list until the next node is the node you're trying to delete, and set the current node's link to the link of the node …

Member Avatar for Narue
0
229
Member Avatar for DoctorBob

>to see who's worked the best. That's going to be difficult even if you just stick to profiling. Two of the algorithms sort arrays and two of them sort linked lists, so the innate performance will be different even without the sort. A better test would sort only linked lists …

Member Avatar for DoctorBob
0
118
Member Avatar for jrice528

I don't think you have a good design. RetailItem should only specify [b]one[/b] item. To get more than one item, you use an array of RetailItems: [code=cplusplus] #include <iomanip> #include <iostream> #include <ostream> #include <string> class RetailItem { std::string _description; double _price; int _on_hand; public: RetailItem ( std::string description, double …

Member Avatar for Narue
0
106
Member Avatar for eranga262154

If I understand your problem correctly, you're over complicating things. The map container doesn't allow duplicates, and the subscript operator alone does what you want: [LIST] [*]If the key doesn't exist, create a new pair and return a reference to the value. [*]If they key already exists, return a reference …

Member Avatar for Narue
0
92
Member Avatar for invisal
Member Avatar for Kiba Ookami

>You have no business telling me what I am or am not alowed to view. I'm sensing some missing steps in the logic chain. Let me spell it out for you: your school owns the internet connection and thus has every right to tell you exactly what you can and …

Member Avatar for joshSCH
0
182
Member Avatar for kaly12

>what does the "\n" do in oppose to endl; ? endl forces the stream to be flushed, which means that the characters will be written immediately. "\n" doesn't flush the stream, so it's possible that if something happens to interrupt the program between the time you write the characters and …

Member Avatar for invisal
0
92
Member Avatar for spankyg

>Can someone please explain to me just exactly this try/catch is doing? It's swallowing errors, basically ignoring them.

Member Avatar for spankyg
0
124
Member Avatar for volia

>Does anyone know of a site that has things like this that I could practice with? Answer questions on this forum. Not only will you get practice solving problems and fixing broken code, you'll also have a bunch of experienced programmers to double check you and teach you tricks.

Member Avatar for Narue
0
69
Member Avatar for kv79

>But why they put a option with struct when they have a class? Why not? How do you know a class was even an option?

Member Avatar for kv79
0
115
Member Avatar for 3nCrypti0n

[code] ShellExecute(0, "open", TEXT("MMPC.html"), 0, 0, SW_SHOWNORMAL) [/code] The TEXT macro either does nothing to the string literal, or prepends L to make it a wide string literal. The errors suggest, that in your setup, a wide string literal is expected. Now, you could just explicitly make the literal wide: …

Member Avatar for Duoas
0
231
Member Avatar for finalheavenx

>#include <iostream.h> C++ is defined by the ISO standard, and that standard doesn't specify iostream.h; it's a pre-standard header that most compilers no longer support. If you learn this old version of the language, you'll be virtually useless with modern C++. >#include <conio.h> I'd recommend you forget that this header …

Member Avatar for WaltP
0
125
Member Avatar for johny112

>it doesnt print £ sign Your text editor is using Unicode, but the console is using extended ASCII. Try this instead: [code=cplusplus] cout<<"Salary is \x9C "<< salary_without_overtime <<endl; [/code]

Member Avatar for iamthwee
0
86
Member Avatar for clockscan

>So basically I am asking for code either using tokens or otherwise that could verify user input Hmm, you probably wouldn't like me to recommend Boost::Regex if you're not terribly comfortable with C++. Are you using C-style strings or the C++ string class to hold the input? >I am an …

Member Avatar for Narue
0
89
Member Avatar for johnnyjohn20

>bool validUserInput (true); This guy should be reset inside the loop. Right now if you fail once, it fails forever. >if ( rate % 2 != 0 ) validUserInput = false ; When rate % 2 is 0, the number is even. This test will set validUserInput to false when …

Member Avatar for johnnyjohn20
0
1K
Member Avatar for iCare

>but why did u make a warning stuff about my language Because that's what our policies dictate (see the emphasized areas for your specific case): [quote] Keep It Clean We strive to be a community geared towards the professional. [B]We strongly encourage all posts to be in full-sentence English. Please …

Member Avatar for Narue
0
173
Member Avatar for stilllearning

[url=http://www.eternallyconfuzzled.com/tuts/datastructures/jsw_tut_hashtable.aspx]Hash tables[/url] [url=http://www.eternallyconfuzzled.com/tuts/algorithms/jsw_tut_hashing.aspx]Hashing algorithms[/url] [url=http://www.eternallyconfuzzled.com/libs/jsw_hlib.zip]Practical implementation[/url] Now quit yer bitchin'. ;)

Member Avatar for stilllearning
0
150
Member Avatar for phalaris_trip

>But how do I go about creating useable names dynamically? Use a map instead of a vector, then you can use a string to index the map instead of an integer, which makes things more meaningful: [code=cplusplus] anims["AnimNormal"]; [/code]

Member Avatar for phalaris_trip
0
102
Member Avatar for sk8ndestroy14
Member Avatar for ravina_malik

>However, am not sure what you mean by n'th last node. Isn't last ... just last? Last is just last, but nth isn't necessarily the last. If you're given n, you delete the node at that position. It's actually painfully easy to do with one traversal if you think about …

Member Avatar for Narue
0
111
Member Avatar for bigt2008

>so foar I've done this much That's not much considering that the majority of the program's implementation consists of abstract comments. What exactly do you need help with? We're not going to finish this for you, you know.

Member Avatar for Lerner
0
89
Member Avatar for tat2dlady

>I'm not sure what you mean by k-way Instead of just taking one stream of data, then dividing and sorting it recursively, a k-way sort divides the initial stream into k smaller streams and sorts each of them individually. By "balanced", it means that the value of k is consistent …

Member Avatar for WaltP
0
417
Member Avatar for GrimJack

I was kind of hoping for more of a psychoanalytic approach. :icon_rolleyes: This thread has promise, but right now promise is all it has.

Member Avatar for GrimJack
0
273
Member Avatar for prati2006

Hi pratiksha. I'm Julienne, and I'm wondering why someone who's working on a doctorate in Computer Science is having trouble selecting a topic.

Member Avatar for jasimp
0
48
Member Avatar for use4d
Member Avatar for sathishkumar.e

>you may not have write access to your command line arguments Both C89 and C99 say otherwise, and they both use exactly the same wording: [quote] The parameters argc and argv and the strings pointed to by the argv array shall be modifiable by the program, and retain their last-stored …

Member Avatar for Duoas
0
134

The End.