chapter

    Linear Data Structures Pyqs for Cmi M.sc. and Ph.d. Computer Science

    Solve 0+ Linear Data Structures previous year questions for CMI M.Sc. and Ph.D. Computer Science with answers and detailed solutions. Free sample questions be

    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Linear Data Structures PYQs for CMI M.Sc. and Ph.D. Computer Science

    Solve 0+ Linear Data Structures previous year questions for CMI M.Sc. and Ph.D. Computer Science with answers and detailed solutions. Free sample questions below.

    Contiguous memory and constant time access

    Intuition

    Contiguous memory and constant time access

    An array is a contiguous block of memory storing elements of fixed size, enabling constant time random access independent of array size.

    The problem it solves

    Imagine a one dimensional array of one hundred integers starting at address one thousand. Each integer occupies exactly four bytes of contiguous physical memory. You can find the tenth integer instantly by calculating its exact offset. Processors use this predictable spacing to fetch data efficiently into cache lines.

    The physical analogy stops being valid when memory is fragmented. Arrays require strictly contiguous physical memory addresses to maintain this access speed.

    The idea made exact
    is the starting memory address is the zero based index is the byte length of one element

    Address calculation for multi-dimensional arrays

    Derivation

    Address calculation for multi-dimensional arrays

    We map a two dimensional array into one dimensional memory using row major storage.

    10 rows 20 columns bytes
    Numbered steps
    1. Count full rows preceding row . This count equals . Rows before each contain all columns.
    2. Multiply this count by the column dimension twenty. This gives the total elements in all preceding full rows.
    3. Count elements in the current row before column . This count equals . Only columns before contribute.
    4. Add the results of step two and step three. This sum is the total number of elements preceding .
    5. Multiply this sum by the element size four. Converts element count to byte offset.
    6. Add the base memory address one thousand. Shifts offset to absolute memory address.
    Final formula
    CHECK

    Set and . The offset becomes zero and the address correctly equals one thousand.

    More previous year questions (pyqs) in this unit