Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 435017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T20:20:00+00:00 2026-05-12T20:20:00+00:00

What is the time complexity of accessing a column by its name in an

  • 0

What is the time complexity of accessing a column by its name in an instance of DataRow?


object Foo(DataRow row, string columnName)
{
    // What is the time complexity of the below line O(1) / O(n) / ?
    return row[columnName];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T20:20:01+00:00Added an answer on May 12, 2026 at 8:20 pm

    I took a peek with Reflector and can confirm that the code in question has a time complexity of O(1). The actual data is stored in DataColumn instances using a plain old array indexed by record number…one array per column. The DataColumn is obtained from the name via a Hashtable and the record number is obtained directly from the DataRow instance. So you have a hash table lookup and an array lookup both of which are O(1).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

for(i=1;i<n*n;i++) for(k=1,l=1;l<n;k=k+2,l=l+k) foo; How would I estimate the time complexity of a construct like
I am trying to check the time complexity of the below simple program. The
My coworker and I were discussing the time complexity of writing a string to
What is the time complexity of the String#substring() method in Java?
The Question What is the most efficient MGU algorithm? What is its time complexity?
Anyone know the time-complexity of ECMAScript5's Object.keys() in common implementations? Is it O(n) for
What is the time complexity of the implementation of a binary tree traversal below?
I deduced the time complexity of bubble sort in its best case according to
Is the time complexity of the Oracle MAX function O(1), O(log n) or O(n)
What is the time complexity of this nifty function 'assoc'?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.