100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Summary dsa begginers CA$11.60   Add to cart

Summary

Summary dsa begginers

 0 view  0 purchase
  • Course
  • Institution

it contains intro to dsa , Constant Time Algorithms,Binary Search Algorithm,arrays and linked list

Preview 2 out of 5  pages

  • May 9, 2023
  • 5
  • 2022/2023
  • Summary
avatar-seller
Data Structures
A data structure organizes data for efficient use and is essential
for creating powerful algorithms. Another reason for using data
structures is to manage and organize data naturally. To
understand the performance that data structures provide, we
need to look at the wild world of computational complexity.
The abstract data type defines how a data structure should
behave and what methods it should have. However, it does not
provide the details surrounding how those methods are
implemented. Big O notation only cares about what happens
when input becomes arbitrarily large, ignoring things like
constants and multiplicative factors. Almost any mathematical
expression containing n can be wrapped around a Big O. If the
algorithm takes logarithmic or quadratic/cubic time, then it's
represented as Big O of a log event.
Constant Time Algorithms
Both of the following algorithms run in constant time relative to
the input size because they are independent of n. As the input
size grows infinitely large, the loop still runs for the same
amount of time.
● Algorithm 1
● Algorithm 2

Binary Search Algorithm
A classic algorithm for binary search has a logarithmic time
complexity. This algorithm starts by creating two pointers: one
at the beginning and one at the end of the array. Then, it selects
a midpoint between the two pointers and checks if the value

, being searched for is found at the midpoint. Regardless of
whether the value is found or not, it discards one half of the
array and adjusts either the high or low pointer accordingly.
This is the first part of a two-part video series on arrays. Arrays
are fundamental building blocks for all other data structures, and
with arrays and pointers alone, it is possible to construct nearly
any data structure.
What is a Static Array?
A static array is a fixed-length container containing elements.
The Access Time for Static Array and a Dynamic Array is
Constant Because of a property that Arrays are indexable.
Searching Can Take up to the Linear Time Because We
Potentially Have to Traverse all the Elements in the Array in the
Worst Case.
Inserting/Appending from a Static Array Doesn't Really Make
Sense. The Static Array is a Fixed Size Container, so It Cannot
Grow Larger or Smaller.
When Inserting with a Dynamic Array, This Operation Can Cost
up Linear Time. If We Look at a, You Can See That it Contains
the Values 4412, -517, 6039, and 100. Currently, All the
Elements are Distinct. However, This is Not at All a
Requirement of the Array.
Also Remark That the Very First Element 44 is Indexed, or
Positioned, at Index of Zero in the Array, Not One. This
Confuses a Lot of Intro Computer Science Students. The

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller sirikakarla. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for CA$11.60. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
CA$11.60
  • (0)
  Add to cart