Skip to content

Details

Hey everyone,
So it looks like we'll be meeting at Hacker Dojo Tuesday night at 7pm
in room 140A (not 140B which is where I think we met last time). Big
thanks to Alison for hosting us.

I'll go over the following two problems and try to answer any
questions about the solutions. The difference between this session
and the usual ones will be an emphasis on particular problems rather
than lectures on general topics in algorihtms. Also feel free to
bring problems to solve with others if you'd like to do mock
interviews.
Best,
Irvin

SOCIAL NETWORK QUESTION
Let's say a social network is a group of people along with information
on who knows who. We'll define knowing someone to be an "asymmetric"
relation in the sense that A can know B, but B might not know A.
We'll say A distantly knows C if A knows C or A knows someone who
distantly knows C (think about the recursive nature of this
definition, try and give a simple example).

Given a social network and an individual, A, in the network write code
to list everyone A distantly knows.
Would wanting to for every member in the network (instead of just one)
who they distantly know change the algorithm?

STRING QUESTION
Write code to find the longest palindrome in a string. e.g. For
ABACDDCQR the longest palindrom is CDDC.

Related topics

You may also like