For my current homework, I'm trying to sort my array through a generic class as the user inserts values into its locations. When the size reads as fully loaded, the array class calls in an expansion method that increases the size of the array while retaining its values in proper locations, which I followed from my Professor's note. For s...
So I have...
int x; LLIST *mylist[x]; x =10;
bzero(mylist, sizeof(LLIST *)*x);
this does not seem to be a valid solution..
I did add the -std=c99 to my make file, just this alone did not work which is why emil suggested the above approach, because I had originally:
int x=10;
LLIST *mylist[x] = {NULL};
My make file lo...
I have the same professor: I have read the forum:
http://stackoverflow.com/questions/2119558/c-help-understanding-how-to-write-a-function-within-a-function-listmap/2119913#2119913
It is very helpful understanding the concept of the function but I'm not sure if I am using it right...
Here is my code.. Let me know if I am on the right ...
I posted a question a few days ago about a linked list in C. I thought everything was ok then the prof emails us saying that instead of this signature:
int insert_intlist( INTLIST* lst, int n); /* Inserts an int (n) into an intlist from the beginning*/
He accidentally meant:
int insert_intlist( INTLIST** lst, int n); /* Inserts an i...
There is a picture book with 100 pages. If dice are rolled randomly to select one of the pages and subsequently rerolled in order to search for a certain picture in the book -- how do I determine the best, worst and average case complexity of this problem?
Proposed answer:
best case: picture is found on the first dice roll
worst case...
I am supposed to write a program that should read from input numbers in the main() part, and then make some calculations in other bool functions. I don't want to insert the whole arrays of the numbers and all the other parameters in the functions everytime i call them.
My question is this: Can i make somehow in c++ to read input in som...
Hi,
This is a very simple question but what does the following function prototype mean?
int square( int y, size_t* x )
what dose the size_t* mean? I know size_t is a data type (int >=0). But how do I read the * attached to it? Is it a pointer to the memory location for x? In general I'm having trouble with this stuff, and if anyb...
Do you know a website that has latest security issue for wireshark that need a solution.
I know wireshark mailing list but is there another website than this?
my teacher is asking us to report 5 problem that need to develop a plugin for wireshark.
Thank you,
...
Hi,
What does the following error mean:
In function `get_ints`:
`l` undeclared (first use in this function)
Thanks,
Josh
...
I'm trying to get a better grasp on pointers. My class assignment was to create the function for the prototype void OpenFile(const char *fileName, ifstream &inFile).
void OpenFile(const char *fileName, ifstream &inFile)
{
inFile.open(FILENAME, ios_base::in);
if (!inFile.is_open()) {
cerr << "Could not open file " << fileNam...
I need to implement the HTTP PUT method in C using TCP socket.
Can anyone help me out?
...
I'm working on an assignment for school, and am trying something beyond for extra credit. The program is to demonstrate the efficiency differences between a linear & binary search for a given array size of integers. I have a loop set up that creates an int[size] array, searches for a random number, then creates a new array of int[size*...
I'm working on a problem where I'm given a sorted array of integers, and I am supposed to take an input from the user, search for the input, and return the first instance of that input (if it exists) and the number of times it appears.
I wrote a program with the following approach: I take an input from the user. I then use binary search...
hi, basically id like a few hints or tips on how to solve this question.. maybe a few things which i could read up on about arraylists and loop which would make it simple for me to understand!..
the question is :
Processing an ArrayList of Characters:
cList is an ArrayList of objects of type Character that has been declared and in...
Hey there. Java beginner here :) Well, I'm having a few troubles with this program: http://pastie.org/private/sfqqnqwxtpgtuhswpqepw
1) I want my program to split up the "input" array into an oddList, evenList and negativeList set of arrays. However, when splitting it up, it is adding a bunch of elements as "0".
2) 0 needs to be added o...
If I have a 5-variable function (below) and I want to implement it using a multiplexer, how would I do that (using the minimum possible multiplexer):
f(A,B,C,D,E) = A + C'D + BD' + B'D + B'CE
This is homework, so don't provide a solution, just a guidance of how that works.
Thanks!
...
This should be a very simple question for anyone who has some experience in this area, but I'm still new to this.
I have the following system (or here is an image with better resolution):
Given the following input:
u = min(2 - t/7.5, 2*(mod(t, 2) < 1));
I need to plot the output of system y.
I am describing the system with the fo...
I have a homework problem which I could use some help on. I need to convert the following EBNF statement to BNF
<S> -> <A>{b<A>}
<A> -> a[b]<A>
This is what I have come up with so far;
<S> -> <A> | <A><S> | b<A>
<A> -> a<A> | ab<A>
It doesn't feel right, mainly because it's a WAG. The example in my book (Concepts of Programming Lan...
My professor defined this in the .h file
void list_map(INTLIST* list, void (*f)(void *)); /*Applies a function to each element of the list */
I wrote the function like this:
void list_map(INTLIST* list, void (*f)(void *))
{
INTLIST* pTemp=NULL;
if (list == NULL)
{
//list is empty
}
else
{
for(p...
Hello,
I am stuck trying to figure out how to do string hashing with linear probing.
Basically, the idea is to hash every string from a dictionary (90000 words), and retrieve anagrams of selected words.
Here's what I did:
created a hash table 2*90000 in size
using a simple hash function, I hash each word from the dictionary, get a v...