Skip to content

Nazmul42726/compiler-leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Compiler Lab LeetCode Solutions

Language Problems Course

This repository contains solutions to LeetCode problems mapped to compiler design concepts as part of the CSE 712: Compilers Lab course.

The goal of this repository is to practice algorithmic problems related to different stages of a compiler such as lexical analysis, parsing, semantic analysis, runtime environments, intermediate code generation, and code optimization.


Course Information

Course: CSE 712 – Compilers Lab
Department of Computer Science and Engineering
University of Chittagong

Student: Md. Nazmul Hasan
Student ID: 22701030
Semester: 7th Semester
Session: 2021–2022


Problem List

Compiler Structure & Phases

Problem Link Solution
Min Stack https://leetcode.com/problems/min-stack Code
Implement Queue using Stacks https://leetcode.com/problems/implement-queue-using-stacks Code

Lexical Analysis – Tokens, Regex, DFA

Problem Link Solution
Valid Palindrome https://leetcode.com/problems/valid-palindrome Code
Ransom Note https://leetcode.com/problems/ransom-note Code
Word Pattern https://leetcode.com/problems/word-pattern Code
Find and Replace Pattern https://leetcode.com/problems/find-and-replace-pattern Code

Finite Automata

Problem Link Solution
Regular Expression Matching https://leetcode.com/problems/regular-expression-matching Code
Find First Occurrence in String https://leetcode.com/problems/find-the-index-of-the-first-occurrence-in-a-string Code
Wildcard Matching https://leetcode.com/problems/wildcard-matching Code
Valid Number https://leetcode.com/problems/valid-number Code
Valid Parenthesis String https://leetcode.com/problems/valid-parenthesis-string Code

Syntax Definition & Parsing

Problem Link Solution
Valid Parentheses https://leetcode.com/problems/valid-parentheses Code
Maximum Nesting Depth of Parentheses https://leetcode.com/problems/maximum-nesting-depth-of-the-parentheses Code
Decode String https://leetcode.com/problems/decode-string Code

Top-Down Parsing – LL(1)

Problem Link Solution
Basic Calculator https://leetcode.com/problems/basic-calculator Code
Basic Calculator II https://leetcode.com/problems/basic-calculator-ii Code
Parsing a Boolean Expression https://leetcode.com/problems/parsing-a-boolean-expression Code

Bottom-Up Parsing – LR

Problem Link Solution
Evaluate Reverse Polish Notation https://leetcode.com/problems/evaluate-reverse-polish-notation Code
Exclusive Time of Functions https://leetcode.com/problems/exclusive-time-of-functions Code
Validate Stack Sequences https://leetcode.com/problems/validate-stack-sequences Code

Syntax-Directed Translation

Problem Link Solution
Mini Parser https://leetcode.com/problems/mini-parser Code

Semantic Analysis

Problem Link Solution
Fraction to Recurring Decimal https://leetcode.com/problems/fraction-to-recurring-decimal Code
Brace Expansion II https://leetcode.com/problems/brace-expansion-ii Code

Run-Time Environments

Problem Link Solution
Remove Outermost Parentheses https://leetcode.com/problems/remove-outermost-parentheses Code
Flatten Nested List Iterator https://leetcode.com/problems/flatten-nested-list-iterator Code

Intermediate Code Generation

Problem Link Solution
Different Ways to Add Parentheses https://leetcode.com/problems/different-ways-to-add-parentheses Code
Serialize and Deserialize Binary Tree https://leetcode.com/problems/serialize-and-deserialize-binary-tree Code

Control Flow Graphs

Problem Link Solution
Course Schedule https://leetcode.com/problems/course-schedule Code
Course Schedule II https://leetcode.com/problems/course-schedule-ii Code
Course Schedule IV https://leetcode.com/problems/course-schedule-iv Code
All Paths From Source to Target https://leetcode.com/problems/all-paths-from-source-to-target Code

Code Optimization

Problem Link Solution
Maximum Subarray https://leetcode.com/problems/maximum-subarray Code
Best Time to Buy and Sell Stock https://leetcode.com/problems/best-time-to-buy-and-sell-stock Code
House Robber https://leetcode.com/problems/house-robber Code
Delete and Earn https://leetcode.com/problems/delete-and-earn Code
Longest Increasing Path in a Matrix https://leetcode.com/problems/longest-increasing-path-in-a-matrix Code
Evaluate Division https://leetcode.com/problems/evaluate-division Code
LRU Cache https://leetcode.com/problems/lru-cache Code
Remove K Digits https://leetcode.com/problems/remove-k-digits Code

License

MIT License
Copyright (c) 2026 Md. Nazmul Hasan

About

LeetCode solutions mapped to Compiler Design concepts (CSE 712 Compilers Lab).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages