Giter Club home page Giter Club logo

dsa-java's People

Contributors

abner3 avatar hankcs avatar jdchoi77 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dsa-java's Issues

[QZ0] Contents of the GitHub repository

Other than creating the two java classes, is there anything else we need to update regarding the files we commit?

I followed the textbook but noticed some differences between mine and those under the course git.

[QZ 0] : build.gradle file, difference between testImplementation and testCompile?

I am confident that my code compiles properly, but I did notice a slight difference between my code in the "build.gradle" file and the professor's code.

Professor's code:

dependencies {
    testImplementation 'junit:junit:4.13'
}

My code:

dependencies {
    testCompile group: 'junit', name: 'junit', version: '4.12'
}

I am wondering about the difference between testImplementation and testCompile. I have a windows computer if that has anything to do with this!

[QZ0] Git interface

I have a question about installing Git. I already have Git installed on my computer, but I have 3 different git applications that were installed: GIT Bash, GIT CMD, and GIT GUI. Are any of these the ones that we are going to be using for class?

[QZ#2]

Hello,

I changed my code and TernaryHeapQuiz passed testRuntime() but failed testRobustness(). I am still getting errors but I do not fully understand them. I have attached the errors and also the error report that IntelliJ gave. (Link to error report: file:///Users/dheepdalamal/IdeaProjects/dsa-java/build/reports/tests/test/classes/edu.emory.cs.queue.TernaryHeapQuizTest.html)

There seems to be an error in remove() and I think it is in sink but I'm not sure what the error is. Could you please help me figure out what the error is and how to solve it? Thanks. My GitHub repository link: https://github.com/ddalama/dsa-java

testRobustErr

full

[QZ1] Helper Methods

Can we create additional helper methods within the LongIntegerQuiz class to use in the addDifferentSign method?

Question About Sign Member Field in Chapter 1.1

In chapter 1, the flipSign method in SignedNumeral interface was defined as sign = (sign == sign.POSITIVE)? Sign.NEGATIVE: Sign.POSITIVE. However, the text said it would cause a compile error since sign is a constant that couldn't have it's value reassigned. Was that because the value for the object sign was instantiated as final in the enum class for Sign or because the sign field was instantiated in an interface version of SignedNumeral?

Sorting Algorithms

Hello,

If QuickSort and MergeSort have the same average-case complexity (n log(n)) and MergeSort's worst-case complexity is better, why is QuickSort more popularly used?

Also, in textbook section 3.1, in the method sort(T[ ] array), when we call sort(array, 0, array.length), I don't understand why we write array.length and not (array.length - 1), since the last index of 'array' would be (array.length - 1). Could you please clarify my confusion?

Thanks.

[QZ#0] Committing files to GitHub

I followed the instructions from the exercises and the code works in my IDE, but it does not appear in my GitHub repository. My repository is missing the src folder, how do upload this to GitHub?

[QZ#1] add() method

What is the difference between digits and n.digits in the LongInteger class?
In L7 of the implementation of addSameSign() in the textbook, what is being compared by the Math.max function?

int m = Math.max(digits.length, n.digits.length);

[QZ0] 1) Gradle/wrapper... 2) adding files/committing 3) src/main/java

Hello,

I have the following issues and would appreciate guidance on how to solve them:

  1. I cannot see gradle/wrapper/gradle-wrapper.properties and therefore I cannot open it.

  2. The end of Textbook chapter 0.1 states, "Add all files and make the initial commit. Check if the repository is created under your GitHub account." I am unsure about how to add all files and make the initial commit. Please suggest how I should do this. Also, how many files should we see in the repository in our GitHub account?

  3. I cannot view src and so cannot access src/main/java.


I have attached a screenshot of my IntelliJ IDEA window below:

HW0 IDEA

[QZ#2] How is add function in the BinaryHeap nlog(2)n?

Replace # in the title with the appropriate quiz number.
I am not understanding how the add function in the BinaryHeap code that was provided to us is nlog(2)n? If we're just adding a node at the end and then swimming it up, it should just be log(2)n not nlog(2)n. This also applies similarly to the ternary heap-shouldn't the add function be log(3)n not nlog(3)n?

[QZ3] Question Regarding class SortTest

Hello everyone. When I tried to create the filed final InputNature nature = InputNature.RANDOM, I kept getting errors that said "Cannot resolve symbol 'InputNature'". Does anyone have any idea why this could happen?

[QZ0] Can't import from org.junit

When I tried to do the test for UtilsTest.java, errors appeared saying "package org.junit does not exist". I wonder if I need to install the package beforehand, or if the problem lies somewhere else.
buhuo2

[QZ1] Starting the Quiz 1

We haven't covered all the material yet in class, but if we want to begin quiz 1, should we start by copying the code for Numeral.java, SignedNumeral.java, and LongInteger.java into a new package on IntelliJ?

[QZ#1 Code won't push]

I tried to push my code earlier today, however, I'm getting some errors when I try to push. I forget what exactly it said, but it was something about refspecs and the name of my repository. My process of pushing has been 1) git add . 2) git commit -m "Quiz 1" 3) git push origin dsa-javaTFII. These steps have worked so far, but today it did not push. Also, it usually always gives me some sort of error when I try to push. I will also include a screenshot of what it looks like when I currently try to push because it gives me the same error.

[QZ#1] Grading Criteria clarification.

I hope everyone is doing well! I'm working on Quiz 1 right now and just wanted to clarify the grading criteria. I tend to get a bit paranoid when it comes to stuff like this so if you don't mind, I'm going to run through my understanding of what is required of us. We cannot copy-paste the code on Github. Is this because that would be considered plagiarism or is that because Dr. Choi wants us to know how the code works? I'm writing the code now but since I'm basing it off the lecture the code is going to end up similar to Dr. Choi's. Sorry if this sounds a bit pedantic--just being careful. My understanding was that this code was made public for us to learn from, so using it would be allowed.

[QZ#1 Specifics]

Does it matter if we push our code and it includes code other than the quiz that will cause an error? For example, I started quiz 2 and some of the heap methods may throw an error. Should we delete those error causing files from the repository for the time being, or will you guys just extract the longintegerquiz file code?

[QZ1] Downloading from GitHub

For the testing Excersise for Quiz 1, it states that we should download LongIntergerQuizTest.java.

How do we download directly from Git Hub?

[QZ0] Git on mac

The book only mentions how to install Git on windows. Please let me know how I can install Git on mac.

[QZ# 2] Heap Correctness Question

So my code passes the testrobustnessaux test for both natural and reverse order, but I am still unsure of its correctness. Instead of pasting my code here, I have provided a pictorial representation of the natural and reverse heap that my code generated. I was wondering if these are correct? The array values are the numbers in the circles and their indexes are the numbers in the top left corner of the numbers in the circle.
IMG_1511

[QZ#2] Errors

Hello,

The 2 images below show the errors I get upon running TernaryHeapQuizTest. Below them, I have attached a picture of my TernaryHeapQuiz class. I would appreciate it if you could help me figure out the issues.

Also, how can I know if my add() and remove() methods are O(log3n)?

Thank you.

Err1

Err2

prog1

[QZ#2] Deciphering Runtime

Hello, I'm all done testing my code but I'm a bit confused about
Screenshot (19)
how to make my code into a graph. I was wondering if I could get some insight into what all the values mean?(i.e X and Y values etc.). I have provided a screenshot of my runtimes for reference.

[QZ 1] Quiz 1 Zero Test Question

I have a simple question for quiz 1. If we create a test for adddifferentsigns adding 0 and -0, should the result be 0 or -0?

[QZ0] Methods in Utils and UtilsTest

Should the code in these files be the code given in the textbook or the code from the links on Quiz 0? There are extra methods in the code on Canvas that are not included in the textbook exercises.

[QZ#1] Overriding addDifferentSigns

I successfully made addDifferentSigns successfully work while within the longinteger file, however when I copy and pasted the method contents into Longintegerquiz and labeled it override and replaced the original addDifferentsigns, the add method will only call the version of addDifferentSigns that throws an error. Also I get an error when I try to run longintegerquiztest because there are 1 arguments in longintegerquiz when there should be 0.``

[QZ1]

I get errors from the import statements in the LongIntegerQuizTest method after copying and pasting it into IntelliJ.

Screen Shot 2020-09-14 at 11 59 43 AM

[QZ#1 A few questions]

I just have a few questions concerning quiz 1, as well as my file structure. For my file structure, I have included a screenshot and was just wondering if it is correct. And for quiz 1, if we altered Dr. Choi's test cases should we change them back to normal? Also, will the readability or efficiency of our method be tested?

[QZ0] Git on Windows / Solution for "Please tell me who you are"

For Windows users who don't have Git installed, you can download it here:
https://git-scm.com/download/win

If the following error comes up, uun the commands below in the IntelliJ terminal and then commit and push.

Successfully created project 'dsa-java' on GitHub, but initial commit failed:
*** Please tell me who you are.

Run

git config --global user.email "[email protected]"
git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

[QZ1] compareAbs method

When using this method, am I supposed to get a negative integer if |digits| > |n.digits| or |n.digits| > |digits|?
I think it should be the former according to javadoc, but I get the latter. (ex: from test2 (digits = 123, n.digits = -0) i get a positive integer 2)

[QZ0] Version of Gradle

  • Hello.

I have a question about the distribution url in the gradle project. Mine ended up saying https://services.gradle.org/distributions/gradle-6.3-bin.zip instead of the 6.5.1 url that was in the book. Is that okay or is that something I need to change?

[QZ#1] Grading

Will quiz 1 be graded solely based on if they passed the tests or will you be looking at the code structure as well?Is there a specific code structure design you are looking for or are we just graded based on functionality?

[QZ0] Problems with pushing files into my Github repository

Hello everyone. I have run into a problem where my pushed files are not shown in my repository.

Screen Shot 2020-08-24 at 11 31 49

I tried to push "src" into my repository and it told me in IDE that everything was up-to-date, but I just couldn't find it on my repository page.

Screen Shot 2020-08-24 at 11 36 23

I also tried to open the files in Github but it told me that it won't open in browser because it couldn't get the last version.

I'm so confused, please help.

[QZ0] How to open gradle/wrapper/....

When trying to follow the setup instructions, I got lost at the following command:

"Open gradle/wrapper/gradle-wrapper.properties and make sure distributionUrl indicates the latest version of Gradle:"

I have already created a gradle project but don't know where to open the directory above(cmd or somewhere on IntelliJ?)

[QZ#0] connection refused to GitHub

Replace # in the title with the appropriate quiz number.
As I sharing the project on the GitHub, the IDE shows that cannot run Git. I am using a mac.
image

[QZ#1] Exercise 0.2

After setting up the environment, I follow the textbook for the exercise and these problems pop up.

Screenshot 2020-08-21 at 10 06 01 PM

Screenshot 2020-08-21 at 10 05 43 PM

[HW#1] Clarification on input.

Is the input going to be one array of each property, or can there be > 5 arrays? Can there be two arrays with the same property in a data set?

[QZ0] "Invalid Path to Command Line Tools" and Initial Commit

After I "Share Project on Github" and create a repository, I receive the following error messages:
errors
The repository exists under my GitHub, but I am not able to initially upload any files to the repository from IntelliJ. Am I misunderstanding that this step is necessary? Will I run into future issues if I just upload files from GitHub?

[QZ1] warnings in code

My code works fine however I have some warnings (shown in the image). Would these affect my grade negatively for quiz 1? They don't seem like a big deal to me but I want to be sure.
2020-09-12

[QZ#2 Coding requirement]

Can we modify the code we have written for the binary heap class for the quiz, or should we be implementing all of the methods from scratch for the ternary heap?

[QZ0] src/main/java creating the package and build.gradle

  1. I don't know how to get to the src/main/java directory under the project so that I can create the package. I tried everything I could think of before I came here to submit this question for help.

  2. Also another issue I am having is that for build.gradle when I added the source and target compatibility it tells me that the assignment isn't being used. I wasn't sure if this was an issue and that I possibly did something wrong. I followed the previous instructions as accurately as I could.

2020-08-22

[QZ#1] Leading 0s

After implementing my method for addDifferentSigns, I get the correct numbers and signs for the tests, however I still have the extra 0s in front of the answer. I tried using a similar idea to the addSameSign method to remove the leading 0s, but I can't get it to work. Is this the right approach to remove the extra 0s for this method?

[QZ#2 Getting started with logic]

I have been attempting to understand the logic of a ternary heap before I get started trying to code. I think a good logic would be parent node at (x - 1)/3 and children at (x * 3) + 1,2,3 for each child. Although I think this logic is solid, I have had some problems translating it into a heap logic. I have thought of two possible scenarios of heap logic and was wondering if any of them sound viable? Logic #1) Each parent and its children are an array of size 4 with the parent first followed by the children, and when that is full a new array is created with one of the children as the 1st node in a new array. Logic #2) Each head element is not part of an array, but the children comprise an array of size 3 for each head. Any feedback on the logic would be greatly appreciated!

[QZ2] Inputting vararg parameters in IntelliJ

Hi everyone! I have a quick question regarding benchmarking in Quiz 2. I am not sure how I can input BinaryHeap and TernaryHeapQuiz as vararg parameters when using the testRobustnessAux() method. I would really appreciate it if someone could explain to me how it works in IntelliJ. Thx!

[QZ1] Java file format

Screen Shot 2020-09-12 at 4 17 48 PM

Screen Shot 2020-09-12 at 4 17 42 PM

My code can pass the unit test, but I cannot seem to commit and push to git. The messages appear as above. Is that due to the wrong format of java files?
I can only create 'file' but not 'java class' under module, and I wonder how that should be dealt.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.