>
Exams
>
Computer Science & Information Technology
>
Data Structures
>
what is the time complexity to insert an element a
Question:
What is the time complexity to insert an element at the beginning of a dynamic array?
Show Hint
Inserting an element at the beginning of an array requires shifting all the elements, which results in O(n) time complexity.
AP PGECET - 2025
AP PGECET
Updated On:
Jun 16, 2025
O(1)
O(n)
O(nlogn)
O(logn)
Hide Solution
Verified By Collegedunia
The Correct Option is
B
Solution and Explanation
In a dynamic array, when an element is inserted at the beginning, all the existing elements have to be shifted one position to the right. Hence, the time complexity for this operation is O(n).
Download Solution in PDF
Was this answer helpful?
0
0
Top Questions on Data Structures
What is a structured Data? Explain its various types.
JKBOSE XII - 2026
Computer Science
Data Structures
View Solution
Define the following: (i) Public (ii) Protected (iii) Private
JKBOSE XII - 2026
Computer Science
Data Structures
View Solution
What is a key?
JKBOSE XII - 2026
Computer Science
Data Structures
View Solution
What is a data structure?
JKBOSE XII - 2026
Computer Science
Data Structures
View Solution
Name any four operations on data structures.
Kerala Plus Two(Class 12) - 2026
Computer Science
Data Structures
View Solution
View More Questions
Questions Asked in AP PGECET exam
The absolute humidity of air at 101.325 kPa is measured to be 0.02 kg of water per kg of dry air. Then the partial pressure of water vapour in the air is:
AP PGECET - 2025
Thermodynamics
View Solution
If the vapour pressure at two temperatures of a solid phase in equilibrium with its liquid phase is known, then the latent heat of fusion can be calculated by the:
AP PGECET - 2025
Thermodynamics
View Solution
1 mole of Argon gas is heated at constant pressure from 200 K to 600 K.
If \( C_p = 4\ \text{cal} \cdot \text{deg}^{-1} \cdot \text{mol}^{-1} \), then the change in entropy will be:
(Given \( \ln 3 = 1.09 \))
AP PGECET - 2025
Thermodynamics
View Solution
The minimum amount of work required to operate a refrigerator which removes 1000 Cal heat at $0^\circ$C and rejects at $50^\circ$C will be:
AP PGECET - 2025
Thermodynamics
View Solution
The entropy of single crystalline Silicon at absolute zero will be:
AP PGECET - 2025
Thermodynamics
View Solution
View More Questions