is a comprehensive book on getting a job at a top tech company, while focuses on dev interviews and does this for PMs.
CareerCup's interview videos give you a real-life look at technical interviews. In these unscripted videos, watch how other candidates handle tough questions and how the interviewer thinks about their performance.
Most engineers make critical mistakes on their resumes -- we can fix your resume with our custom resume review service. And, we use fellow engineers as our resume reviewers, so you can be sure that we "get" what you're saying.
Our Mock Interviews will be conducted "in character" just like a real interview, and can focus on whatever topics you want. All our interviewers have worked for Microsoft, Google or Amazon, you know you'll get a true-to-life experience.
use a link list with each node having an array of type int of some predefined size SIZE. create more and more nodes in link list as the data is read from the file. the last node can have the array partially filled so you will have to count either the total elements read from the file or total valid elements in the array contained in last node.
something like:
Here we have used m_nTotalElementsContained which tells total number of elements. We could also have used m_nTotalElementsContainedInLastArray, which will hold the number of elements in the last node's Array. The total elements in that case could have been calculated by
both having their advantages. Compared to a link list node having a single value rather than array, it saves (TotalElements - (TotalElements / SIZE))*sizeof(int*) number of bytes of memory.
- abhityagi85 October 18, 2011Let us say TotalElements = 1000, SIZE=10, thus it becomes (1000 - 1000/10) * (4) for 32 bit OS
900*4=3600. Thus 3600 bytes are saved for 1000 elements compared to a linklist having 1 value rather than array.