Skip to content

Instantly share code, notes, and snippets.

View ahmedsamirsaid's full-sized avatar

ahmed samir sayed ahmed ahmedsamirsaid

View GitHub Profile
@ahmedsamirsaid
ahmedsamirsaid / CSE326_Lab_03.md
Last active November 7, 2025 01:05
Lab 03 problems and solutions.

CSE326 Algorithms Lab 03 Solutions

Problem 1: Kth Largest Element in an Array

Leetcode Problem: Kth Largest Element in an Array

  • Heap Solution

Java

public int findKthLargest(int[] nums, int k) {
    PriorityQueue<Integer> minHeap = new PriorityQueue<>();
    for (int i = 0; i < k; i++) {
@ahmedsamirsaid
ahmedsamirsaid / create_schema.sql
Last active August 10, 2024 10:27
Inventory management system
create database InventoryManagement;
use InventoryManagement;
CREATE TABLE Employee (
emp_id INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(255) NOT NULL,
Position VARCHAR(100),
DoB DATE,
email VARCHAR(255) UNIQUE, -- Unique index on email
phone VARCHAR(20),