Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 150
» Latest member: Spooky Boogie
» Forum threads: 123
» Forum posts: 377

Full Statistics

Online Users
There are currently 11 online users.
» 2 Member(s) | 9 Guest(s)
mpar

Latest Threads
Master Recurrence Theorem...
Forum: Exam 1
Last Post: jvteel
1 hour ago
» Replies: 1
» Views: 25
master theorem between ca...
Forum: Exam 1
Last Post: scao7
2 hours ago
» Replies: 0
» Views: 23
Is Exam 1 tomorrow?
Forum: Exam 1
Last Post: hajames
2 hours ago
» Replies: 1
» Views: 48
Time taken for valgrind
Forum: Project 1
Last Post: NickXIV
5 hours ago
» Replies: 0
» Views: 12
submission3.tgz
Forum: Project 0
Last Post: BigMike
8 hours ago
» Replies: 0
» Views: 13
Program to compare output
Forum: Project 1
Last Post: aashmangupta
8 hours ago
» Replies: 0
» Views: 17
Real Values - Six Decimal...
Forum: Project 1
Last Post: azhall
8 hours ago
» Replies: 0
» Views: 21
Visualization Resource
Forum: Exam 1
Last Post: carobinson5
8 hours ago
» Replies: 1
» Views: 81
Question 15 on the Practi...
Forum: Exam 1
Last Post: azhall
8 hours ago
» Replies: 0
» Views: 45
bst-0-4.c
Forum: Project 1
Last Post: sbcarp
9 hours ago
» Replies: 2
» Views: 39

 
  Master Recurrence Theorem: Order of Cases
Posted by: hajames - 1 hour ago - Forum: Exam 1 - Replies (1)

For the MRT, is the following case order correct?

Case 1: Recursion dominates
Case 2: Neither dominate
Case 3: Work at a level dominates

I've seen some discrepancy between various websites and my notes. Thanks!

Print this item

  master theorem between case.
Posted by: scao7 - 2 hours ago - Forum: Exam 1 - No Replies

I have a question about the master theorem between case.

question number 77.  I got an answer which is nlog^2n however there is not a such answer.
I guess it might be the between case or something else. 


[Image: ?ui=2&ik=394149d24f&view=fimg&th=161b152...&zw&atsh=1]

Print this item

  Is Exam 1 tomorrow?
Posted by: sbcarp - 3 hours ago - Forum: Exam 1 - Replies (1)

Just for double check, Thanks

Print this item

  Time taken for valgrind
Posted by: NickXIV - 5 hours ago - Forum: Project 1 - No Replies

Will there be an allotted time that valgrind should finish in? For the larger test cases in heap, it takes up to 4 seconds for it to run through for me

Print this item

  submission3.tgz
Posted by: BigMike - 8 hours ago - Forum: Project 0 - No Replies

Unless I am doing something incorrectly, I am unable to get the submission3.tgz file using wget. When I try to it just gives me a 404 after connecting to beastie. Is it currently available?

Print this item

  Program to compare output
Posted by: aashmangupta - 8 hours ago - Forum: Project 1 - No Replies

I made this simple program to help me compare my output to the expected results. It accounts for whitespace as well. just copy and paste your output in a file, and paste the expected output in a separate file. Run the program by using this: ./a.out (yourFileName) (yourFileName)

Code:
/* Author: Aashman Gupta
* to run this program use: ./a.out yourResults expectedResults
*/

#include<stdlib.h>
#include<stdio.h>
#include<string.h>

int main(int argc, char* argv[]) {

    FILE* testFile = fopen(argv[1], "r");
    FILE* myFile = fopen(argv[2], "r");

    char currChar = fgetc(testFile);
    char myChar = fgetc(myFile);

    printf("Comparing character by character...\n");

    int flag = 0;

    while(!feof(testFile) && !feof(myFile)) {
        if(currChar != myChar) {
            flag = 1;
        }

        if(testFile != 0) {
            currChar = fgetc(testFile);
        }

        if(myFile != 0) {
            myChar = fgetc(myFile);
        }
    }

    printf("Done comparing...\n");

    if(flag == 0) {
        printf("Both the files have the same input.\n");
    }

    else {
        printf("The files have a discrepancy.\n");
    }
    
    fclose(testFile);
    fclose(myFile);

return 0;
}

Print this item

  Real Values - Six Decimal Places
Posted by: azhall - 8 hours ago - Forum: Project 1 - No Replies

Is there a way we were supposed to know that it was six decimal places on the real values? I reread the spec and I couldn't find and I just wanted to make sure for future projects that I don't miss something like this again. My values were correct but they only did 4 numbers after the decimal instead of 6. Thanks!

Print this item

  Question 15 on the Practice Exam (Exam posted on the Forum)
Posted by: azhall - 8 hours ago - Forum: Exam 1 - No Replies

For number 15, after you insert the node with the number 4, you have a red uncle case. You color 1 black (the uncle), 3 black (the parent) and then 2 red (the grandparent). You then recolor 2 black because it is the root of the tree. Is each coloring of the of 2 counted? Making the count for this step four and the total count 6. Therefore making the answer A none of the other answers are correct.

Print this item

  bst-0-4.c
Posted by: sbcarp - 10 hours ago - Forum: Project 1 - Replies (2)

Quote:The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.
The test shows minimum depth 0 for the tree:
                                                                  12
                                                                  /
                                                                 8
                                                                /
                                                               0
                                                                \
                                                                 1
Could anyone explain it? Thanks!

Quote:TEST #36
     test program is bst-0-4.c (alloted time: 2s)

EXPECTED RESULTS:
--------------------------------------------------------------
pre-order: [10 [5 [0 [3 [1]]] [7 [6] [9 [8]]]] [12 [11]]]
level: 10
5 12
0 7 11
3 6 9
1 8
size is 11
pre-order: [12 [8 [0 [1]]]]
level: 12
8
0
1
size is 4
Nodes: 4
Minimum depth: 0
Maximum depth: 3
--------------------------------------------------------------

Print this item

  Visualization Resource
Posted by: Bdjones13 - Yesterday, 05:44 PM - Forum: Exam 1 - Replies (1)

This website has visualizations for the majority of the algorithms and data structures that we need to know. https://www.cs.usfca.edu/~galles/visuali...ithms.html

Print this item