Coding challenges
In this repository, I store my solutioins to the common programming problems. Currently, I try to implement each solution in Python and Java, maybe sometimes C++. By doing so, I can compare languages with respect to implementations.
The solutions in this repo are not meant to be the best ones. You may find better solutions out there. What is more, you can come up with your own solution which can be considered as the best one. Bear in mind that in practice optimal solution depends on various parameters such as workset data, environment, constraints etc.
Linked Lists
Challenge
Description
Python
Java
C++
Implement a sorted linked list
-
-
-
Solution
Remove duplicates from a linked list
Challenge
-
-
Solution
Find the kth to last element of a linked list
Challenge
-
-
Solution
Delete a node in the middle of a linked list
Challenge
-
-
-
Partition a linked list around a given value
Challenge
-
-
-
Add two numbers whose digits are stored in a linked list
Challenge
-
-
-
Find the start of a linked list loop
Challenge
-
-
-
Determine if a linked list is a palindrome
Challenge
-
-
-
Implement a linked list
Challenge
-
-
-
Determine if a list is cyclic or acyclic
Contribute
-
-
-
Stacks and Queues
Challenge
Description
Python
Java
C++
Implement a stack using a linked list
-
-
Solution
-
Implement a stack using a fixed array
-
-
Solution
-
Implement a stack using a resizable array
-
-
Solution
-
Implement a queue using a linked list
-
-
Solution
-
Implement a queue using a fixed array
-
-
Solution
-
Implement a queue using a resizable array
-
-
Solution
-
Sorting
Challenge
Description
Python
Java
C++
Implement an insertion sorting .
-
-
Solution
-
Implement a selection sorting .
-
-
Solution
-
Implement a shell sorting .
-
-
Solution
-
Trees and Graphs
Challenge
Description
Python
Java
C++
Given an array A of integers, find any 3 of them that sum to 0.
Definition
-
Solution
-
Implement Union-Find algorithm
Definition
-
Solution
-
Graphs and Trees
Challenge
Description
Python
Java
C++
Implement depth-first search (pre-, in-, post-order) on a tree
Challenge
-
Solution
-
Implement breadth-first search on a tree
Challenge
-
Solution
-
Determine the height of a tree
Challenge
-
-
-
Create a binary search tree with minimal height from a sorted array
Challenge
-
-
-
Find diameter length and nodes of a binary tree
-
-
Solution
-
Create a linked list for each level of a binary tree
Challenge
-
-
-
Check if a binary tree is balanced
Challenge
-
-
-
Determine if a tree is a valid binary search tree
Challenge
-
-
-
Find the in-order successor of a given node in a binary search tree.
Challenge
-
-
-
Implement a binary search tree
Challenge
-
-
-
Implement depth-first search on a graph
Challenge
-
-
-
Implement breadth-first search on a graph
Challenge
-
-
-
Determine if there is a path between two nodes in a graph
Challenge
-
-
-
Implement a graph
Challenge
-
-
-
Print a tree using pre-order traversal without recursion
Contribute
-
-
-
Determine the lowest common ancestor of two nodes
Contribute
-
-
-
Transform a binary tree into a heap
Contribute
-
-
-
Implement a right and left rotation on a tree
Contribute
-
-
-
Check if a binary tree is binary search tree
Contribute
-
-
-
Add a challenge
Contribute
-
-
-
10 Days of Statistics
https://www.hackerrank.com/domains/tutorials/10-days-of-statistics
Hackerrank Random
https://www.hackerrank.com/challenges/
https://github.com/donnemartin/interactive-coding-challenges
Code reviews and comments, even new challenges are very welcomed :)