aboutme.txt
with the following information:
Your name: Your student ID: Your major: Your preferred email address: Check one: [ ] Undergraduate, [ ] Graduate, [ ] Open university Graduating senior? [ ] Yes, [ ] No Repeating the class? [ ] Yes, [ ] No Place and semester where you took a programming course in Java: Course number and grade received: Place and semester where you took a course in data structures: Course number and grade received: Time it took you to answer the two questions below: Did you ask anyone for help? [ ] Yes, [ ] No Preferred section (if adding): [ ] 3, [ ] 4, [ ] 6 Other acceptable sections (if adding):
Lists.swapLargestAndSecondSmallest(ArrayList<Integer> a)
that swaps the largest and second smallest element in a
. If there are multiple largest or second smallest elements, pick the first one. If all elements are the same, don't change anything. Your algorithm should be O(n). Check your answer with CodeCheckEncoding.morseCodes(int m, int n)
that yields a set of all Morse code strings with m
dots and n
dashes. For example, morseCodes(2, 1)
yields a set with ..- .-. ..- -..
in some order. Hint: Recursion. Start with a dot, and then what? Start with a dash, and then what? Check your answer with CodeCheckImportant: The point of this assigment is for you to demonstrate that you already know how to program. This is not a class for students who can't yet program. Do not ask anyone for help. If you need to ask someone for help, or if it takes you longer than an hour to do this assignment, do not take this class. Take CS46A/B instead.
Important: Make sure your code passes CodeCheck. In particular, that means that you must use no package declarations!
Important: Make a Git repo for all your work in this class. Put your work for this homework into a folder hw1
, i.e. the files aboutme.txt
, Lists.java
, and Encoding.java
. Make sure these files do not have package declarations.
Add me and the grader as contributors to your repo. Our BitBucket and GitHub ids are cayhorstmann
and cs251spring19
.
Did I mention that your files should not have package declarations?
Send an email to Cay.Horstmann@sjsu.edu with subject line
CS151 Repo
and the URL to your repo in the body of your message.
Important: If you are currently enrolled in the class, you must turn in a complete or partial solution to this assignment by the deadline, or you may be dropped from the class. If you are trying to add the class, you will receive an add code after you have turned in the assignment.