Some algorithm questions