quickpuzzlesolver
BAN USERThe http request goes to the dns server...gets resolved to an ipadress.
The ipadress is then located as the call travels through a series of routers(Part of tcp/ip).
The server then process the request and emits html which travels back to the source
as a http response(application layer) riding over tcp/ip.
A class "ParkingLot" would be an aggregate of "ParkingSpot".
The other main class would be the "ParkingEntryGate" at which you need collect a "Ticket".
The ParkingEntryGate would maintain the details of the "Vehicle" and the time in.
Another good feature would be a "FreeParkingSpotBillboard" which notifies people as to which parking spots are free. The "ParkingSpot" would be associated with a unique id.
Another Entity would be the "Customer" who has a "Vehicle" and a "Ticket". There would be a method named GetCustomerDetails inside "ParkingLot" which would tell us the details of time spent inside parking for each customer by date. Every customer would have a unique id.
Basically one needs to conceptualize the various entities and make a domain driven design.
(This could be used at the Parking Entry Gate with a front end of a web application if required.)
A runtime puncture is a puncture that happens when the car is moving
You need to use Observer pattern
The car is the observer and the wheels are the subject. Whenever a wheel is punctured it raises a callback on the car and notifies it that it got punctured.
Longest Zig Zag path = Diameter of tree
- quickpuzzlesolver December 25, 2011There are two ways to solve this
1.)Calculate DFS to furthest node. From furthest node, recompute DFS for longest path
2.)
ll = Calculate diameter of left sub tree
lr = Calculate diameter of right subtree
ld = Calculate Height of left + right sub tree + 1
calculate max of above quantities in a recursive manner