Tag: CodingInterview

Two Sum II

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. CheckPoint:  if (numbers != null && numbers.length > 1) {throw new IllegalArgumentException(“No solution!”);}

Array Implementation of Queue (Fixed size)

github:arrayQueue.java.  Purpose: reuse a fixed size array. —-> Tracking 2 variables frontIndex for deletion and rearIndex for insertion.

Implement Queue using Stacks

github: ImplementQueueusingStacks.java Using 2 stacks- s1 and s2 to implement a queue. Purpose: keep the input on the bottom of s1

Palindrome Checker

github: Palindrome.java A few good ways to remove space from a string.

Reverse String

#1- For loop: #2- Iterative Swapping Using Two Pointers Reference: https://www.ratchapong.com/algorithm-practice/leetcode/reverse-string