Skip to content

Commit

Permalink
Tweaks to solutions 174 & 183
Browse files Browse the repository at this point in the history
  • Loading branch information
WHAHA-HA committed Feb 2, 2021
1 parent 771c424 commit caa4969
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
11 changes: 8 additions & 3 deletions Solutions/174.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
```
Problem:
Describe and give an example of each of the following types of polymorphism:
- Ad-hoc polymorphism
Expand All @@ -13,10 +15,13 @@ Describe and give an example of each of the following types of polymorphism:

## Parametric polymorphism

- This allows a function to deal with generics, and therefore on any concrete definition of the generic.
- This allows a function to deal with generics, and therefore on any concrete
definition of the generic.
- e.g. A List type in Java, regardless of which objects are in the list

## Subtype polymorphism

- This allows subclass instances to be treated by a function they same way as it would superclass instances
- e.g. Instances of Cat will be operated on a function the same way as instances of it's superclass Animal.
- This allows subclass instances to be treated by a function they same way as it
would superclass instances
- e.g. Instances of Cat will be operated on a function the same way as instances of
it's superclass Animal.
8 changes: 6 additions & 2 deletions Solutions/183.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
```
Problem:
Describe what happens when you type a URL into your browser and press Enter.
```

## Process of a URL being fetched

1. The browser's host resolution cache is checked if the website's IP is stored.
2. If the IP is not found, a request is sent to the Domain Name Service (DNS) for the IP of the host/load balancing host.
2. If the IP is not found, a request is sent to the Domain Name Service (DNS) for the
IP of the host/load balancing host.
3. A HTTP GET request is sent to the host (server).
4. The host responds with a payload (usually in HTML).
5. Browser renders the received HTML.
6. The browser sends requests for additional objects embedded in HTML (images, CSS, JavaScript) and repeats steps 3-4 to perform step 5.
6. The browser sends requests for additional objects embedded in HTML (images, CSS,
JavaScript) and repeats steps 3-4 to perform step 5.
7. Once the page is loaded, the browser sends further asynchronous requests as needed.

0 comments on commit caa4969

Please sign in to comment.