This sounds like something that would be easier to do with something other than arrays...as mentioned above, you could use a map.
You could do a struct of users. Each user would have a balance and...
Type: Posts; User: Linell Bonnette
This sounds like something that would be easier to do with something other than arrays...as mentioned above, you could use a map.
You could do a struct of users. Each user would have a balance and...
The code I have isn't right, and I know it. However, I've spent a few hours on this and don't know what else to do. I know the basics of insertion sort, but linked lists confuse me.
In other...
What should I pass through to it? I've tried passing a nine through, which should work, right? Same problem.
Here it is in its entirety:
/*
Linell
Due on 11/11/11 <- I'm totally getting Skyrim
at 11:59 tonight.
*/
Thank you for all of the responses!
However, when I tried to do this the simplest way that I could (simply making n equal to the size of the array I'm testing for), it still doesn't do anything....
I've tried to make a few different heapify functions, but none of them have worked. Why isn't this actually doing anything?
void heapify(int array[], int i) {
int largest = 0;
int temp...
I was thinking that I would have to get to the stack class from main. Would I be able to just have that done inside of the stack class?
I've changed the code to be
class stack
{
public:
...
So I would start off with the something like
int data = new int [CAPACITY], right? After that, during the push
(if q1.queue_size() >= s2->CAPACITY) {resize_capacity(2);} , or something along...
We're not allowed to use vector and deque.
I'm missing a dynamic array, mostly. I need to have it somehow allocated at run-time. My main problem is that I'm not sure how I can pass the capacity...
I'm trying to take this non-dynamic array and make it dynamic.
I can't wrap my head around how I would implement the following code using a dynamic array. Two stacks from this class will be used to make a queue class.
I know how dynamic arrays work, but...
void bag::operator -=(const bag& sub)
// Library facilities used: cstdlib, node1.h
{
node *cursor;
for (cursor = sub.head_ptr; cursor != NULL; cursor = cursor-> link()...
Sorry for the confusion. The order does not matter, it simply seeks to remove any matching element. If there are items found in b2 that aren't found in b1, then it shouldn't be found in b3-which is...
I'm trying to overload the - and -= operators for use on a linked list. I need to be able to subtract two linked lists. So if, as an example, I had
{2,2,2,3,2,2,1} - {2,2,3} I would get
{2,2,2,1}...
Where is the variable x coming from? You open the file and you go into a loop, but you don't actually read in x. Put a priming read (read in x) before the while loop and then read in another x at the...