Skip to content

matinarabhosseini/data-structures-ca1-python

Repository files navigation

Data Structures CA1 - Algorithmic Problem Solving

This repository contains solutions to four algorithmic problems implemented in Python as part of the Data Structures course assignments.

The project focuses on string manipulation, interval processing, combinatorial search, and sequence analysis.


Problems

Problem 1 — String Expression Processor

A custom string expression evaluator supporting special operators:

  • + : character interleaving
  • * : character repetition
  • ** : string repetition

Example:

Input:

"ab"**2+"c"*2

Output:

aaccbbaabb

Concepts used:

  • String manipulation
  • Expression parsing
  • Sequential evaluation

Problem 2 — Maximum Overlap Interval Detection

Given multiple time intervals, determine the longest interval during which the maximum number of events overlap.

Example:

Input:

04:30-06:00 05:20-06:45 07:00-08:30

Output:

05:20-06:00

Concepts used:

  • Sweep Line Algorithm
  • Event sorting
  • Interval processing

Problem 3 — Goal Matching Grid Game

A 4×4 board contains players and corresponding goals.

The objective is to determine the maximum number of successful player-to-goal matches while respecting movement constraints and blocking rules.

Concepts used:

  • Grid traversal
  • Simulation
  • Permutation generation
  • Combinatorial search

Problem 4 — Minimum Deletion Subsequence Matching

Given two strings, determine the minimum number of deletions required from a selected segment of the first string so that the second string becomes a subsequence.

Concepts used:

  • Greedy matching
  • String scanning
  • Subsequence analysis

Repository Structure

.
├── problem1.py
├── problem2.py
├── problem3.py
├── problem4.py
└── README.md

Technologies

  • Python 3
  • Standard Library

Educational Objectives

This assignment was designed to strengthen practical skills in:

  • Algorithm design
  • Complexity analysis
  • String processing
  • Search techniques
  • Data manipulation

Course Information

Data Structures Course

Spring 2025

University Assignment

About

Solutions to Data Structures course assignment problems implemented in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages