Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

Python data structure and algorithms

Rating
-
Sold
-
Pages
5
Uploaded on
05-04-2026
Written in
2025/2026

Providing in depth concept understanding of the following list concept understanding

Institution
Course

Content preview

Python Data Structures & Algorithms – Full Notes
+ Solved Questions

1. Lists
• Ordered, mutable collection
• Example:


lst = [1, 2, 3]
lst.append(4)



2. Tuples
• Ordered, immutable


t = (1, 2, 3)



3. Sets
• Unordered, unique elements


s = {1, 2, 3}
s.add(4)



4. Dictionaries
• Key-value pairs


d = {"a":1, "b":2}




5. Stacks
• LIFO (Last In First Out)




1

, stack = []
stack.append(1)
stack.pop()



6. Queues
• FIFO (First In First Out)


from collections import deque
q = deque()
q.append(1)
q.popleft()




7. Searching Algorithms

Linear Search


def linear_search(arr, x):
for i in range(len(arr)):
if arr[i] == x:
return i
return -1


Binary Search


def binary_search(arr, x):
low, high = 0, len(arr)-1
while low <= high:
mid = (low + high)//2
if arr[mid] == x:
return mid
elif arr[mid] < x:
low = mid + 1
else:
high = mid - 1
return -1




2

Written for

Institution
Course

Document information

Uploaded on
April 5, 2026
Number of pages
5
Written in
2025/2026
Type
OTHER
Person
Unknown

Subjects

$8.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
anshikasaxena1

Get to know the seller

Seller avatar
anshikasaxena1
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
1 month
Number of followers
0
Documents
2
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions