- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
I found numerous examples on converting infix expression to postfix expression but my program needs to include some functions like sqrt(x), min/max(x,y), fact(x), abs(x). abs(‐5) is converted to ‐5 abs 120 – (45+3) is converted to 120 45 3 + ‐ (3^2 + 4^5)*fact(3) is converted to 3 2 ^ … |
|
I have found numerous examples involving only arithmetic operations but mine requires to deal with functions - min(x, y), max(x, y), sqrt(x), abs(x), fact(x). What I don't understand is how my program can interpret those functions and set the precedence for them. Examples: 4 + 5 -> 4 5 + … |
|
I need to read words from a text file, build a structure to store the word and its occurrence. From what I was told from my TA, I need to read words, determine its size (how many chars) and allocate memory for its size. Then I need to build an … |
|
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> typedef struct { int count; // counter to use the word's occurrence char word[99]; } word; char str[99]; word myword[50]; int main() { FILE *myfile; if ((myfile = fopen("wordlist", "r")) == NULL) { printf("\n Error:Can't open file \n "); exit(0); } int position = … |
|
[CODE]#include <stdio.h> #include <string.h> typedef struct { int count; // counter to use the word's occurrence char *word; } word; int main() { word myword[50]; FILE *myfile; if ((myfile = fopen("wordlist", "r")) == NULL) { printf("\n Error:Can't open file \n "); exit(0); } char str[99]; int position = 0; while … |
|
I'm supposed to read all the words from text file and use bubble sort to sort the word and count their occurrence. As I read each word from file, what is the exact thing I need to do? Do I need to store the word (as char array) somewhere to … |
|
I understand the concept of bubble sort and have no trouble implementing it, but I can't grasp the concept of doing it for 2D array. I've googled for some resources but I was unable to understand those codes. So let's say I have a 2D char array with words (maximum … |