Pregunta de entrevista de Microsoft

Write a function to list all documents under your C: drive.

Respuesta de la entrevista

Anónimo

16 mar 2010

create a recursive function that would return the list of documents from a folder.. It'd go something like (ya sorry for the bad coding standard here) function ListofDocuments SearchFolder(folder name) var tempDocuments = new ListofDocuments(); For each folder in current folder tempDocuments =+ SearchFolder(thisFolder) Loop tempDocuments += get documents from current folder return tempDocuments End Now run: print SearchFolder("C:\")