Forum: C++ Feb 28th, 2009 |
| Replies: 2 Views: 425 |
Forum: C++ Feb 28th, 2009 |
| Replies: 2 Views: 425 Ok here is the code I am trying to compile remotly on a linux machine
I am getting quite a few compile errors when I try to compile this
Here is just a sample of the errors I am getting.... |
Forum: C++ Nov 17th, 2008 |
| Replies: 7 Views: 1,438 I found out what I was doing wrong I put the function heading like this
Queue* DepthFirstSearch(string startVertex, string endVertex);
instead of like this
Queue* Graph::DepthFirstSearch(string... |
Forum: C++ Nov 16th, 2008 |
| Replies: 7 Views: 1,438 I don't understand what I am doing wrong in the DFS function. Since the DFS function is is declared in the graph.h file and it is part of the class in the definition, why can't I just call the... |
Forum: C++ Nov 15th, 2008 |
| Replies: 7 Views: 1,438 I am having a problem writing the last part of my code for this program.
There is a DFS function that I need to write that is included in the header file of the graph.h my program.
Here is the... |
Forum: C++ Nov 14th, 2008 |
| Replies: 1 Views: 424 The function that I am having a problem with is in the middle of this seperated from the rest of the code.
#ifndef GRAPH_H
#define GRAPH_H
#include <string>
#include "queue.h"
using... |
Forum: C++ Nov 12th, 2008 |
| Replies: 2 Views: 589 Sorry to be so vague but here are my instructions.
I understand what a graph is but I just dont know how to impliment it.
Your main function must perform all of the following tasks.
(1)... |
Forum: C++ Nov 11th, 2008 |
| Replies: 2 Views: 589 This grap is kicking my butt. I am not sure how to do it. Can someone please help explain these to me.
// graph.h
// -- adjacency list representation of a weighted graph
//
#ifndef GRAPH_H... |
Forum: C++ Oct 30th, 2008 |
| Replies: 2 Views: 516 I need some help with this binary search tree. I am having a problem printing out the tree. I don't quite understand how to do it. I know that I need to use recursive call to traverse to the end of... |
Forum: C++ Oct 24th, 2008 |
| Replies: 3 Views: 422 Thanks for looking at it but I figured it out finally.
heres what I did.
while(rearPtr != frontPtr)
{
QueueNode<SomeType>* dequeuePtr = frontPtr;
frontPtr = frontPtr->nextPtr;
delete... |
Forum: C++ Oct 24th, 2008 |
| Replies: 3 Views: 422 yea I know I spelled destructor wrong what can I say my fingers got in the way of my typing
I have scoured the internet and tried several different ways to implement the destructor on my link list... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 5 Views: 589 I found the problem
I should have just set countPtr = frontPtr outside the while loop.
I did the same thing you did. |
Forum: C++ Oct 23rd, 2008 |
| Replies: 5 Views: 589 Ok I changed this part
template<class SomeType>
void TemplateQ<SomeType>::Enqueue(SomeType newData)
{
if (IsFull())
throw FullTemplateQ();
else
{
QueueNode<SomeType>*... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 5 Views: 589 When I try to compile and run this file I get a segmentation fault when the size function is called so I must not have it set up right.
The size function returns the number of stored chars in the... |
Forum: C++ Oct 21st, 2008 |
| Replies: 5 Views: 562 ok I was asking because my driver program was not written yet and I have no way of checking it without it. |
Forum: C++ Oct 21st, 2008 |
| Replies: 5 Views: 562 so then will this work
template<class SomeType>
int TemplateQ<SomeType>::Size() const
{
int numberOfChars = 0;
QueueNode<SomeType>* countPtr;
if(IsEmpty)
return 0; |
Forum: C++ Oct 21st, 2008 |
| Replies: 5 Views: 562 All this function is supposed to do is count each node in the queue and return the number of nodes.
template<class SomeType>
int TemplateQ<SomeType>::Size() const
{
int numberOfChars = 0;... |
Forum: C++ Oct 19th, 2008 |
| Replies: 6 Views: 607 Here is the instructions. These are what I am bounded to.
templateq.h
UNMODIFIED specification file for the TemplateQ class as supplied by the instructor
Note: This file must end with the... |
Forum: C++ Oct 19th, 2008 |
| Replies: 6 Views: 607 I am not allowed to modify the class file at all. This was provided by instructor with the instructions do not modify this file. |
Forum: C++ Oct 19th, 2008 |
| Replies: 6 Views: 607 according to my instructions #include "template.h" is not supposed to be there. |
Forum: C++ Oct 19th, 2008 |
| Replies: 6 Views: 607 I am getting a syntax error when I try to compile. After I write a little code I try to compile to catch any of my mistakes.
In this project I am to use a class queue template that is provided by... |
Forum: C++ Oct 3rd, 2008 |
| Replies: 8 Views: 1,074 Is there anybody out there who can help me with this I am stll not getting the desired output |
Forum: C++ Oct 3rd, 2008 |
| Replies: 8 Views: 1,074 Actually this is suppose to be a stack of stacks one is implemented as array pointing to a stack and the other is almost a linked list but the only difference is that lhe list is traversed backwards... |
Forum: C++ Oct 2nd, 2008 |
| Replies: 8 Views: 1,074 Ok here is the whole thing except I took out the delete tempPtr
This is the ministack.h file
//
// ministack.h
//
#ifndef MINISTACK_H |
Forum: C++ Oct 2nd, 2008 |
| Replies: 8 Views: 1,074 First let me describe the program
All it does is pull in some chars and stores them in a linked list of stacks.
I have the code written to pull them in but when I need to print them I dont know how... |
Forum: C++ Sep 26th, 2008 |
| Replies: 1 Views: 1,064 I was trying to figure this out but for some reason it is illuding me
Ministack header provided
#ifndef MINISTACK_H
#define MINISTACK_H
const int MINI_STACK_SIZE = 5; // Fixed number... |
Forum: C++ Sep 25th, 2008 |
| Replies: 1 Views: 598 Header file provided by instructor
#ifndef BIGSTACK_H
#define BIGSTACK_H
#include "ministack.h"
struct ListNode // Description of a ListNode struct |
Forum: C++ Sep 24th, 2008 |
| Replies: 4 Views: 384 Thanks that is exactly what the problem was. using namespace std; was what was needed |
Forum: C++ Sep 24th, 2008 |
| Replies: 4 Views: 384 void MiniStack::Print() const
{
int n;
for (n=4; n==0; n--)
{
cout << stackPtr[n] << " ";
}
}
The compiler keeps giving me "cout undeclared [first use of this function]" |
Forum: C++ Sep 24th, 2008 |
| Replies: 4 Views: 384 Here is the header file I was given to use
//
// ministack.h
//
#ifndef MINISTACK_H
#define MINISTACK_H |
Forum: C++ Sep 18th, 2008 |
| Replies: 1 Views: 360 This is the header file provided by my instructor.
//
// unsortedlist.h
//
#ifndef UNSORTED_LIST_H
#define UNSORTED_LIST_H
struct UnsortedListNode // Description of list node |