Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
54 changes: 27 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -8,32 +8,32 @@ You can also refer to my [Java Notes](http://blog.rampatra.com/category/java) fo

## Contents

1. [Basic Practice](/src/main/java/com/rampatra/):
1. [Arrays](/src/main/java/com/rampatra/arrays)
2. [Backtracking](/src/main/java/com/rampatra/backtracking)
3. [Bits](/src/main/java/com/rampatra/bits)
4. [Blockchain Demo](/src/main/java/com/rampatra/blockchain)
5. [Dynamic Programming](/src/main/java/com/rampatra/dynamicprogramming)
6. [Graphs](/src/main/java/com/rampatra/graphs)
7. [Java 8](/src/main/java/com/rampatra/java8)
8. [Linked Lists](/src/main/java/com/rampatra/linkedlists)
9. [Miscellaneous](/src/main/java/com/rampatra/misc)
10. [Permutations](/src/main/java/com/rampatra/permutations)
11. [Searching](/src/main/java/com/rampatra/searching)
12. [Sorting](/src/main/java/com/rampatra/sorting)
13. [Stacks](/src/main/java/com/rampatra/stacks)
14. [Strings](/src/main/java/com/rampatra/strings)
15. [Threads](/src/main/java/com/rampatra/threads)
16. [Trees](/src/main/java/com/rampatra/trees)
2. [Cracking the Coding Interview](/src/main/java/com/ctci):
1. [Arrays and Strings](/src/main/java/com/ctci/arraysandstrings)
2. [Linked Lists](/src/main/java/com/ctci/linkedlists)
3. [Stacks and Queues](/src/main/java/com/ctci/stacksandqueues)
4. [Trees and Graphs](/src/main/java/com/ctci/treesandgraphs)
5. [Bit Manipulation](/src/main/java/com/ctci/bitmanipulation)
6. [Recursion and DP](/src/main/java/com/ctci/recursionanddp)
3. [LeetCode](/src/main/java/com/leetcode).
4. [HackerRank](/src/main/java/com/hackerrank).
1. [Basic Practice](/my/com/rampatra/):
1. [Arrays](/my/com/rampatra/arrays)
2. [Backtracking](/my/com/rampatra/backtracking)
3. [Bits](/my/com/rampatra/bits)
4. [Blockchain Demo](/my/com/rampatra/blockchain)
5. [Dynamic Programming](/my/com/rampatra/dynamicprogramming)
6. [Graphs](/my/com/rampatra/graphs)
7. [Java 8](/my/com/rampatra/java8)
8. [Linked Lists](/my/com/rampatra/linkedlists)
9. [Miscellaneous](/my/com/rampatra/misc)
10. [Permutations](/my/com/rampatra/permutations)
11. [Searching](/my/com/rampatra/searching)
12. [Sorting](/my/com/rampatra/sorting)
13. [Stacks](/my/com/rampatra/stacks)
14. [Strings](/my/com/rampatra/strings)
15. [Threads](/my/com/rampatra/threads)
16. [Trees](/my/com/rampatra/trees)
2. [Cracking the Coding Interview](/my/com/ctci):
1. [Arrays and Strings](/my/com/ctci/arraysandstrings)
2. [Linked Lists](/my/com/ctci/linkedlists)
3. [Stacks and Queues](/my/com/ctci/stacksandqueues)
4. [Trees and Graphs](/my/com/ctci/treesandgraphs)
5. [Bit Manipulation](/my/com/ctci/bitmanipulation)
6. [Recursion and DP](/my/com/ctci/recursionanddp)
3. [LeetCode](/my/com/leetcode).
4. [HackerRank](/my/com/hackerrank).


## Environment
@@ -53,4 +53,4 @@ MacBook Pro

---

_P.S. For any queries or concerns, you can reach out to me on [Twitter](https://twitter.com/ram__patra). I'll try my best to help 🙏. And, if you're keen to know what I'm currently working on then check out [Presentify](https://presentify.compzets.com)._
_P.S. For any queries or concerns, you can reach out to me on [Twitter](https://twitter.com/ram__patra). I'll try my best to help 🙏. And, if you're keen to know what I'm currently working on then check out [Presentify](https://presentifyapp.com), or [ToDoBar](https://todobarapp.com/)._
5 changes: 5 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -60,6 +60,11 @@
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.1</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-base</artifactId>
<version>21</version>
</dependency>
</dependencies>

<profiles>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

import java.util.Arrays;

@@ -15,7 +15,7 @@ public class CheckPermutation {
* @param s2
* @return
*/
private static boolean isOnePermutationOfOther(String s1, String s2) {
public static boolean isOnePermutationOfOther(String s1, String s2) {
if (s1.length() != s2.length()) {
return false;
}
@@ -35,7 +35,7 @@ private static boolean isOnePermutationOfOther(String s1, String s2) {
* @param s2
* @return
*/
private static boolean isOnePermutationOfOtherGivenThatStringsContainOnlyAscii(String s1, String s2) {
public static boolean isOnePermutationOfOtherGivenThatStringsContainOnlyAscii(String s1, String s2) {
if (s1.length() != s2.length()) {
return false;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

import java.util.HashMap;
import java.util.Map;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

/**
* Assume you have a method isSubString which checks if one word is a substring of another. Given two
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.arraysandstrings;
package my.com.ctci.arraysandstrings;

import java.util.ArrayList;
import java.util.List;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

import java.util.Arrays;

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.bitmanipulation;
package my.com.ctci.bitmanipulation;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

import my.com.rampatra.linkedlists.DetectAndRemoveLoop;

/**
* @author rampatra
@@ -15,7 +17,7 @@ public class LoopDetection {
* Input: A -> B -> C -> D -> E -> C [the same C as earlier]
* Output: C
* <p>
* See {@link com.rampatra.linkedlists.DetectAndRemoveLoop} for a slightly more complex problem.
* See {@link DetectAndRemoveLoop} for a slightly more complex problem.
*
* @param head the starting node of the linked list
* @return the {@code Node} where the loop starts, {@code null} otherwise.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

import java.util.Stack;

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

/**
* Write code to partition a linked list around a value x, such that all nodes less than x come before all
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

import java.util.HashSet;
import java.util.Set;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.linkedlists;
package my.com.ctci.linkedlists;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.ctci.recursionanddp;
package my.com.ctci.recursionanddp;

import my.com.rampatra.dynamicprogramming.FibonacciNumbers;

/**
* The fabled fibonacci numbers problem with three different solutions.
* The {@link FibonacciNumber#fibonacciBottomUpOptimized(int)} version is the most optimized among all w.r.t space
* and time. See {@link com.rampatra.dynamicprogramming.FibonacciNumbers} for Fibonacci series.
* and time. See {@link FibonacciNumbers} for Fibonacci series.
*
* @author rampatra
* @since 2019-02-26
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.stacksandqueues;
package my.com.ctci.stacksandqueues;

import java.util.NoSuchElementException;
import java.util.Stack;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.stacksandqueues;
package my.com.ctci.stacksandqueues;

import java.util.Arrays;
import java.util.Stack;
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.ctci.stacksandqueues;
package my.com.ctci.stacksandqueues;


import com.sun.tools.javac.util.Assert;

import java.util.Stack;

@@ -45,18 +45,18 @@ private static void minPop(int item) {
}

public static void main(String[] args) {
push(2);
push(5);
push(1);
push(1);
push(6);
push(8);
Assert.check(min() == 1);
pop();
pop();
pop();
Assert.check(min() == 1);
pop();
Assert.check(min() == 2);
// push(2);
// push(5);
// push(1);
// push(1);
// push(6);
// push(8);
// Assert.check(min() == 1);
// pop();
// pop();
// pop();
// Assert.check(min() == 1);
// pop();
// Assert.check(min() == 2);
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.stacksandqueues;
package my.com.ctci.stacksandqueues;

import java.util.ArrayList;
import java.util.Collection;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

import java.util.ArrayList;
import java.util.HashMap;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

/**
* Implement a function to check if a binary tree is balanced. For the purposes of this question, a balanced
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

/**
* @author rampatra
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

import my.com.rampatra.trees.LeastCommonAncestorInBT;

/**
* Design an algorithm and write code to find the first common ancestor of two nodes in a binary
@@ -21,7 +23,7 @@ public class FirstCommonAncestor {
* - Returns null, if neither p nor q are in root's subtree.
* - Else, returns the common ancestor of p and q.
* <p>
* See {@link com.rampatra.trees.LeastCommonAncestorInBT} for a better answer.
* See {@link LeastCommonAncestorInBT} for a better answer.
*
* @param root
* @param a
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

/**
* Design an algorithm and write code to find the first common ancestor of two nodes in a binary
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

import java.util.HashSet;
import java.util.Set;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

import java.util.ArrayList;
import java.util.List;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.ctci.treesandgraphs;
package my.com.ctci.treesandgraphs;

/**
* Given a sorted (increasing order) array with unique integer elements, write
Loading
Oops, something went wrong.