Cse 326: Data Structures


Download 427.79 Kb.
bet2/3
Sana18.12.2022
Hajmi427.79 Kb.
#1027857
1   2   3

Another critical facet of DSA usage in software development is the time and space constraints. These constraints check the availability of time and space for the algorithm. An optimized algorithm addresses both of these constraints based on the availability of resources. If memory is not an issue for the hardware, DSA focuses more on optimizing the running time of the algorithm. Similarly, if the hardware has both the constraints, then DSA must address both of them. You can learn more about the representation of these complexities on Asymptotics Analysis.

  • Another critical facet of DSA usage in software development is the time and space constraints. These constraints check the availability of time and space for the algorithm. An optimized algorithm addresses both of these constraints based on the availability of resources. If memory is not an issue for the hardware, DSA focuses more on optimizing the running time of the algorithm. Similarly, if the hardware has both the constraints, then DSA must address both of them. You can learn more about the representation of these complexities on Asymptotics Analysis.

Data structure and Bio-O notation.

How can you relate DSA to your day to day life?

  • Data Structures
  • Stack Data Structure to Reverse a String
  • A stack is a linear data structure, "linear" meaning the elements are placed one after the other. An element can be accessed only after accessing the previous elements.
  • We can visualize a stack like a pile of plates placed on top of each other. Each plate below the topmost plate cannot be directly accessed until the plates above are removed. Plates can be added and removed from the top only.
  • Each plate is an element and the pile is the stack. In the programming terms, each plate is a variable and the pile is a data structure.

Why do we need a stack representation?

  • You might be wondering why a programmer needs to learn how to put a plate on a pile and take the plate out from the pile. Let's find the answer to it. You are assigned a task of reversing a string. How would you do it?

Download 427.79 Kb.

Do'stlaringiz bilan baham:
1   2   3




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling