Sunday, March 30, 2008
Pascal's Triangle
Monday, March 17, 2008
New Weekly Question
DP Weekly Question #1
Part a.)
In this part, we will be looking at data structures. This problem will use only two data structures, a stack and a queue. A stack is a Last-In-First-Out (LIFO) data structure, meaning that the first element that you can access out of the data structure is the last one you inserted. A stack supports two operations, push() and pop(). A push() pushes an element on to the top of the stack, and a pop() takes the top element off the stack and returns it. A queue (pronounced like the letter Q) is a First-In-First-Out (FIFO) data structure. The first element you insert will also be the first element you take out of the data structure. Queues support two operations: enqueue() and dequeue().
Enqueue() adds an element to the data structure, and dequeue removes an element from the data structure.
A queue is normally represented by using a list. However, it can also be implemented by only using Stacks in the internal representation. The problem is: Design a Queue data structure class by only using Stacks (java.util.Stack -
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Stack.html) in the internal representation. Provide a constructor, and support the operations Enqueue(), Dequeue(), and Empty() which returns True if the Queue is empty, and false otherwise. Be careful to handle the case of underflow errors (when you try to remove an element from the queue when there are no elements in it).
Answers are required to be in Java or C#, but answers will be provided in Java.
Part b.)
In this part, we will ask a relatively simple question. You are given an array of arbitrary length filled with random integers. The elements are in no order. Also, there are duplicates of elements in the array.
Write a function that returns a new array with all the duplicates of any element removed, such that there is only one of each element in the new array.
In this problem, wee are looking for an efficient solution. Some aspects of efficiency are space used (number of variables and arrays
allocated) and the running time of the algorithm. First try to implement any solution that accomplishes the given task. Then look for ways to improve your solution.
Again, answers are required to be in Java or C#, but solutions will be provided in Java.
Please submit all answers to Knichel@seas.upenn.edu by March 28, 2008.
Sunday, February 17, 2008
2008 PClassic Results
Here's the results:
| Horace Mann-2 | 77 |
| Radnor | 64 |
| Horace Mann-1 | 60 |
| Germantown | 37 |
| St. Joes Prep | 20 |
| Friends Select | 17 |
This year's question set can be downloaded here.
Answers will be available soon.
Pictures from this year's contest are available here and on our Picasa album.
If you require publication-quality copies of the pictures, please email pclassic@gmail.com.
![]() |
| PClassic 2008 Programmin |
Thursday, January 31, 2008
Last chance!
Additionally, this year's contest plans to use the PC2 Programming Contest environment. Information is available from the project page.
Sunday, January 13, 2008
Directions to Penn Campus
The contest will be held in the Engineering buildings, in the middle of campus, at 34th and Walnut Sts.
Thursday, January 10, 2008
Philadelphia Classic 2008
Each school can bring a team of 4 high school students and one teacher/sponsor. The registration fee is $25 - this includes lunch and t-shirts for the participants. Trophies and prizes will be awarded to the winning teams. (If space/time permits, schools wishing to bring more than one team may be allowed to bring others).
The event is tentatively scheduled for schools to arrive between 9am and 10am, and for the contest to be complete by 4:30 or 5pm. A more detailed schedule will be available as the date approaches.
To register, please send an email to pclassic@gmail.com with the school's name, student names and t-shirt sizes, and teacher/sponsor contact information. Invitations will be sent to past attendees as well as Philadelphia-area high schools, but all schools are welcome to register and attend, and we ask that you share information about the contest with other possibly interested schools.
Questions? Please comment here or email pclassic@gmail.com
Thursday, November 29, 2007
2007 PClassic Questions Available for Download
While we’ve had some server trouble, I’ve uploaded the questions to last year’s contest to the web. They’re accessible here:
Computer Science Curriculum and Experience Discussion
The Dining Philosophers and WICS, Penn’s clubs for undergrads in computer science, are proud to announce a roundtable discussion.
WHAT: Come talk about computer science at Penn, the department, the curriculum and what it means to you. Complain about the classes, or share ideas for the future. Give input of any kind.
We’ll turn the output of the evening into an official position paper to be published and shared. Undergrads only – no grad students, no faculty, no staff. Everyone is free to speak all they want – no ideas will be turned away.
WHEN: Wednesday, December 5, 2007. 6:30 to 8:30 PM
WHERE: Levine 307 (the big conference room)
FOOD (free, of course) will be served! Please RSVP if you can, so we know how much food to order
Topics to be discussed (just the beginning…): curriculum, advising, careers, social experience, teaching, anything!
Matt Evans
President, Dining Philosophers
Wednesday, November 14, 2007
Penn CIS Whitepaper
The event is scheduled to be held:
Wednesday, December 5th, 2007 at 6:30pm in Levine 307. Hope to see you there!
Philadelphia Classic
The contest is a day long contest at the University of Pennsylvania. High schools can submit teams of 4 students who will compete to answer 8 programming questions.
All Philadelphia-region high schools are invited.
