Recent content by Firestrider

  1. F

    System of equations using modulo

    Homework Statement 5) Determine the inverse of the matrix \begin{bmatrix} 6 & 17\\ 13 & 21 \end{bmatrix} mod 26 Homework Equations Solve for linear system of equations: 6a + 17c = 1 mod 26 6b + 17d = 0 mod 26 13a + 21c = 0 mod 26 13b + 21d = 1 mod 26 The Attempt at a...
  2. F

    How Do You Solve an Affine Cipher with Given Mappings?

    Homework Statement 7) You are attempting to break an affine cipher. You believe that the ciphertext ‘a’ maps to the plaintext letter ‘E’ and that the ciphertext ‘v’ maps to the plaintext ‘T’. Determine the encryption function used based on these two pieces of information. Homework Equations...
  3. F

    Rope tension on a mountain climber

    Homework Statement A mountain climber, in the process of crossing between two cliffs by a rope, pauses to rest. She weighs 586 N. As the drawing shows, she is closer to the left cliff than to the right cliff, with the result that the tensions in the left and right sides of the rope are not...
  4. F

    Merge sort with array of structs

    That works when I change temp to a pointer to a struct, but I get weird values when accessing pieces of the struct. It probably has something do with how memory is allocated. Does anyone know why I get that error from my previous post? I'm running into this a lot and I'm not sure why I get it.
  5. F

    Merge sort with array of structs

    Hi, and thanks for your help. When I do this: temp[mc].first_name = birthdays[count1].first_name; I get the error "incompatible types in assignment" This is the function: void Merge(struct student_birthday birthdays[], int start, int middle, int end)
  6. F

    Merge sort with array of structs

    It seems I have to use the strcmp function for the second code block. Does anyone know why this statement will not work: struct student_birthday* temp; int i, length, count1, count2, mc; length = end - start + 1; temp = calloc(length, sizeof(struct student_birthday))...
  7. F

    Merge sort with array of structs

    Homework Statement I need to be able to copy full structs in a temporary array based on a value in that struct (an integer), but I'm not sure exactly how to go about it. I have commented where I need to copy over structs. Also in the other code block, what is the problem here? It doesn't...
  8. F

    Reversing an Integer String Using Linked List

    Ok I seemed to fix print() and read_integer(). I now am working on the add() function for two linked lists. The problems I'm having with it are listed on the top in comments. I know the problem originates on how the loop executes, but I'm not sure how I can change it. // ! CRASHES IF...
  9. F

    Reversing an Integer String Using Linked List

    Argh, this is hard. I can't tell if the node is being added to the front or the back of the list. I think this is how it needs to be set up: print <--add node v [X|int_n]<--[ |int_2]<--[ |int_1]<--[ |int_0] Is there...
  10. F

    Reversing an Integer String Using Linked List

    Ok seems to be working now, and I have it read in the integer string in reverse. What I'm having trouble doing is printing it in reverse again. I know the front of the list is returned and I have to go to the back of the list and print from the back to the front. Any hints on how to do this...
  11. F

    Reversing an Integer String Using Linked List

    Thanks for the help Coin! It seems to read and print the right number now, except there is some random numbers after the string. It is probably happening because I'm not freeing or allocating memory somewhere but I can't see it. struct integer* read_integer(char* stringInt) { int...
  12. F

    Reversing an Integer String Using Linked List

    Can you please explain this: struct integer* read_integer(char* stringInt) { struct integer* pInt = (struct integer*)(malloc(sizeof(struct integer))); pInt->digit = stringInt[0] - '0'; pInt->next = (struct integer*)(malloc(sizeof(struct integer))); pInt = pInt->next...
  13. F

    Reversing an Integer String Using Linked List

    Oh I thought the list (loop) would terminate when the "integer" string reaches the null character. How can I terminate the list? I'm not even sure if it's being stored correctly, is it?
  14. F

    Reversing an Integer String Using Linked List

    Can someone help me on how exactly to do this? I'm trying to read an integer string and each "digit" in the string is put at the front of the linked list (i.e. reverse order). When I print it out I want it to reverse again. I know I'm not implementing it right because when I run it the program...
  15. F

    Engineering Circuit Analysis: Find V_0 for R_eq = 3kOhm and I_s = 6mA

    Ok well the first two circuits on the left can connect in series to make 6kohm, then the circuits can connect in parallel to make 4kohm, then connect in series to make 6kohm, and then in parallel again to make 2kohm. So, V_0 = 6 x 10^-3 * 2 x 10^3 = 12V? I have 2 other problems attached...
Back
Top