Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
1 answer
201 views

Given a sorted (increasing order) array, write an algorithm to create a binary tree with minimal height

I'm trying to find the complexity of this code and some suggestions for improving the code quality. and handling the code gracefully, esp in the areas of exception handling, checking edge cases, ...
user2769790's user avatar
4 votes
4 answers
5k views

Getting max and min values from Array

My code works; I am just seeing if there's an optimized way to write these methods or even better perhaps combine them (since majority of their contents look similar). ...
PacificNW_Lover's user avatar
3 votes
4 answers
721 views

Unit testing for concatenating two int arrays

Using Java 1.8, I created the following implementation to concat two int arrays: ...
PacificNW_Lover's user avatar
6 votes
1 answer
1k views

Piece class as part of implementation for the Tetris game

Here is my Piece class as part of implementation for the Tetris game. If possible, I want my code to face the same level of scrutiny as actual production code. ...
Thor's user avatar
  • 627
6 votes
2 answers
908 views

Find number of plus in a 2d array

Problem CharGrid The CharGrid class encapsulates a 2-d char array with a couple operations. int countPlus() Look for a '+' pattern in the grid made ...
Thor's user avatar
  • 627
4 votes
2 answers
224 views

DoublingQueue in Java

Inspired by this CR question, I decided to create my own queue! If you guys see anything taboo or have any improvements, please let me know. Ultimately I want it to be feature rich and bug free, with ...
T145's user avatar
  • 3,149
12 votes
5 answers
691 views

FiniteArrayQueue type with interface and unit tests

Doing some exercises on basic data structures, I learned about queues, and decided to roll my own to better understand how a basic queue can function. As the name indicates, this Queue is made from a ...
Phrancis's user avatar
  • 20.5k