2023spring DSA Syllabus
2023spring DSA Syllabus
2023spring DSA Syllabus
Workload
It is estimated that the students will need to solve up to 10 programming problems per week.
Students will need from 4 to 6 hours per week for assignments.
Assessment
The bulk of the assessment is weekly programming tasks at www.e-olymp.com online judge
systems, which involve solving problems using efficient algorithms learned in lectures. Students spend
up to 6 hours per week on these assignments and often consult frequently with section instructors for
help. Exercises for assessment are available at e-olymp.com in a separate group only for students and
their tutor. Deadline for each contest is 2 weeks. A mid-term exam and a final exam account for a
significant portion of the grade.
HOMEWORK 2
Quiz 2
8 Sorting algorithms STL sort, swap sort
How to write a comparator
Count inversions
Counting sort
Quiz 3
MIDTERM
Week 1: January 23 - 29
Recursive functions: factorial, power, fibonacci numbers.
2. Digits (number of digits)
1603. The sum of digits
1658. Factorial (n!)
2999. Function-10 (recursive function)
8609. Recursion – 1
Exponentiation:
273. Modular Exponentiation
4439. Exponentiation
Fibonacci:
3258. Fibonacci Sequence
4730. Fibonacci
Binomial coefficient:
3260. How Many? (Cnk)
Greater Common Divisor & Least Common Multiple:
1601. GCD two numbers
1602. LCM of two positive integers
Different problems:
5123. Hailstone HOTPO
141. The minimal sum of digits
8377. Persistent number
Math problems:
9052. Headshot
10452. The essay
10405. Teleportation
2,1603,1658,2999,8609,273,4439,3258,4730,3260,1601,1602,5123,141,8377,9052,10452,10
405
5198,9644,9557,9592,7363,136,6941,4730,263,4469,5091,5092,8295,1616,572,4739,3843
Week 3: February 6 - 12
Recursive functions
1207. Sqrt log sin
1211. Infinite sequence
1212. Infinite sequence – 2
10165. Function f(n)
10296. Recursive function 1
3936. Towers of Hanoi
6155. Wrong monks
8304. Fun function
1520. Odd divisors
1517. Simple addition
1343. Bad substring
5973. Out of the line!
6583. Counting ones
2177. Function Run Fun
1207,1211,1212,10165,10296,3936,6155,8304,1520,1517,1343,5973,6583,2177
Week 4: February 13 – 19
Linear DP
1560. Decreasing number
1619. House robber
9628. Frog
799. Buying tickets
987. Nails
44. The number of ones
798. Platforms
806. Platforms 3
Square DP
683. Partial matrix sum
4018. Turtle
4019. Turtle restoring
4021. Knight move
1704. Clever turtle
3174. North East King
5101. Hodja Nasreddin
1560,1619,9628,799,987,44,798,806,683,4018,4019,4021,1704,3174,5101
Week 5: February 20 - 26
Stack
6122. Simple stack
6123. Stack with error protection
5087. Implement a stack
5327. Bracket sequence
2479. Parentheses balance
5060. Revere Polish notation
940. Majority element
4259. Minimum in the stack
1776. Rails
Deque
6128. Simple deque
6129. Deque with error protection
8355. Book shelf
3161. Deques on 6 Megabytes
10143. Throwing cards away
10142. Power of time
6122,6123,5087,5327,2479,5060,940,4259,1776,6128,6129,8355,3161,10143,10142
Week 7: March 6 – 12
Binary trees
10063. Tree find
10061. Tree minimum element
10062. Tree maximum element
10146. Tree next
10147. Tree previous
10109. Tree minimum depth
10110. Tree maximum depth
10057. Tree PreOrder Traversal
10059. Tree InOrder Traversal
10060. Tree PostOrder Traversal
10064. Tree sum of elements
10111. Tree sum of left leaves
10112. Tree Balanced
10113. Tree sum of leaves
10114. Tree invert
10115. Tree Symmetric
10063,10061,10062,10146,10147,10109,10110,10057,10059,10060,10064,10111,10112,
10113,10114,10115
March 13 – 19
MIDTERM
March 20 – 26
NOVRUZ HOLIDAYS
2321,4738,4848,8735,1457,8316,2166,2323,2325,8317,9648,2327,2617,145,7809,972,1462,
8236,8637,3937,10246
Week 9: April 3 – 9
Adjacency matrix: count number of edges
992. Cities and roads
5072. Count number of edges
Adjacency matrix: properties
994. Coloured rain
Convert from one representation to another
2471. From adjacency matrix to the list of edges
4766. From adjacency matrix to the list of edges – 2
3981. From adjacency matrix to adjacency list
3982. From adjacency list to adjacency matrix
4763. From list of edges to adjacency matrix
Checking the graph properties
2470. Checking for an undirected graph
3987. Complete graph
4761. Loops
5073. Multiedges
5080. Number of hanging vertices 1
5088. Number of hanging vertices 2
Degree of vertices
993. Traffic lights
4764. Degrees of vertices
5074. Degrees of vertices by a list of edges
5076. Regular graph
3986. Sources and sinks
Adjacency list
2472. Operations on graph
992,5072,994,2471,4766,3981,3982,4763,2470,3987,4761,5073,5080,5088,993,4764,5074
,5076,3986,2472
8760,978,977,6033,4077,2269,982,4000,5339,776,2157,10653,10684
8761,9654,1390,4004,2270,7945,3165,4002,2590,2168,1063,1685,4001,7024
2401,4852,5338,4819,4853,4369,10049,10056,10048,10050,9635,10116
Week 13, 14: May 1 – 13
Dijkstra – weight matrix
2351. Dijkstra
4856. The shortest path
8348. Distance between vertices
34. The word of sponsor
1388. Petrol stations
5850. Mathematical platforms
9608. Taxi
Dijkstra – priority queue
2965. Distance between the vertices
625. Distance between the vertices
7710. Change of Scenery
10456. Server
2351,4856,8348,34,1388,5850,9608,2965,625,7710,10456