Skip to content

Latest commit

 

History

History
39 lines (25 loc) · 830 Bytes

File metadata and controls

39 lines (25 loc) · 830 Bytes

Algorithm-Questions

Solutions to some algorithm questions.

The islands question:

In an array of equal-index-size (a square), 0 represents water, and 1 represents lands. All edges are considered 0 (water) regardless of value. Q: Calculate the number of islands in a given square.

E.g.

100110010 011010101 011100110 000010010 100101011 011010101 011100110 000010010 100101011

A: island_question.py

The age array question:

An array containing the age of every Australian is made.

E.g. 1,1,1,1,1,2,2,2,2,2,2,4,4,4,4,4,4.

Q: What's the most effecient way to get each unique age?

A: age_array.py

The web log question:

Q: Whats the most efficient way to get the most common transition between web pages? (Fields for each log are name, timestamp, website).

A: web_log.py.

If you have any questions, read the answer code.