ADTs refresher Project
Euclidean points. Create a data type EuclideanPoint (prefix your file with your initials YI_EuclideanPoint.java) that represents a d-dimensional point.
1. Write a method so that p.distanceTo(q) returns the Euclidean distance between points p and q.
2. Write a method so that p.midPoint(q) returns the Euclidean mid-point between points p and q.
3. Include a test class with at least three pair of points with different dimensions.
4. Before you start the implementation, use paper and pencil to show few examples using illustrations and computations.
Category Archives: Activity
K-d Trees Programming Project
Practice updating the repositories
January 11th, 2016
Practice updating the repositories, local and remote with the program assigned in edmodo.com
Philadelphia Classic Spring 2016 Contest
November 23rd, 2015
Philadelphia Classic Spring 2016 Contest
Start from problems 4 on in class and for homework.
Work with a partner. DO NOT LOOK FOR THE SOLUTIONS
Pay special attention to the following:
1. Make sure you read the instructions in the first 2 pages.
2. Read the problem many times before you get started.
3. Draft a plan on paper or a document before you start.
4. Test parts of the code before you develop the “whole” program.
5. Do not use outside help of any sort.
6. All students have to turn in the assignments to edmodo.com
Shellsort story
from Maha Hadaya
Once upon a time, Yami Yugi had a huge array of yugioh cards that needed to be sorted . Since he had collected them all, there were too many for a deck, so , he decided to go and separate his cards into stacks. Each deck could only hold 40 cards, since any more cards would decrease his drawing power. Having a limited amount of time , Yami realized he could not just trust the heart of the cards, such that it was up to him to sort his cards out manually. He broke the cards into stacks of 40 , in order to prevent the deck from spilling over when he used his deck box to separate the stacks. Now he had all the stacks, and decided to sort all of his stacks going from the top of the deck and comparing the second card and continuing with n to n+1. Spells and Traps had 0 atk, so they were moved to the top of the sets of 40. Now that Yami had his sets of yugioh cards sorted, he could sort everything by comparing stacks in the style of insertion sort as he had each individual stack.
Pi Day Activity
Monday is Pi Day – We will have a pi-day activity ending on Monday.
There are many algorithms designed to calculate the digits of pi.
1. Find at least 4 of them and show their time and space complexity. Explain their complexity.
2. List them from least efficient to most efficient.
3. Describe how you would implement the most efficient.
DOCUMENT YOUR MATHEMATICAL EXPRESSION AND THE LINK TO THE RESOURCE.