Question 61Asked in Bihar STET 2025 Paper II Computer Science, 3 Nov 2025, Shift 1 (9:00 AM)

For a 2-D array represented in row-major order, the index formula to access the elementरो-मेजर ऑर्डर में प्रतिनिधित्व किए गए 2-डी सरणी के लिए, रोज़ "I" और कॉलम "J" पर तत्व को

For a 2-D array represented in row-major order, the index formula to access the element at row "i" and column "j" using the base address "B" is:
रो-मेजर ऑर्डर में प्रतिनिधित्व किए गए 2-डी सरणी के लिए, रोज़ "I" और कॉलम "J" पर तत्व को एक्सेस करने के लिए इंडेक्स फॉर्मूला "B" का उपयोग करके "B" है:
  1. AIndex = B + (i * n + j)सूचकांक = b + (i * n + j)
  2. BIndex = B + (j * n + i)सूचकांक = b + (j * n + i)
  3. CIndex = B + (i + j)सूचकांक = b + (i + j)
  4. DIndex = B + (i * m + j)सूचकांक = b + (i * m + j)
Show answerHide answer

Correct answer: (A) Index = B + (i * n + j)सूचकांक = b + (i * n + j)

Explanation

In row-major order, rows are stored one after another, so element (i, j) is at B + (i × n + j) × element size, where n is the number of columns. Option D would use m, the row count.Row-major क्रम में पंक्तियाँ एक के बाद एक संग्रहीत होती हैं, इसलिए तत्व (i, j) B + (i × n + j) × तत्व का आकार पर होता है, जहाँ n स्तंभों की संख्या है। विकल्प D में m (पंक्तियों की संख्या) लगता।

From Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 1 (9:00 AM)

This is question 61 of Bihar STET 2025 Paper II Computer Science PYQ, 3 Nov 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.