Skip to main content

All Questions

1 vote
2 answers
147 views

How can I optimize this Binary Search Tree?

I've added some methods to a basic BST implementation for integers - if anyone can point out some ways that this could be written in a more efficient or clean manner, please let me know. ...
SomeoneLearning17's user avatar
3 votes
1 answer
81 views

Data-type implementation for multiple dynamic histograms

This is almost exercise 3.2.14. from the book Computer Science An Interdisciplinary Approach by Sedgewick & Wayne (since I am self-studying, I changed it a little bit): Develop a version of ...
Khashayar Baghizadeh's user avatar
4 votes
1 answer
731 views

java : jumping caterpillar program

Looking for code review, suggestions for improvement, best practices etc. Given N leaves numbered from 1 to N . A caterpillar at leaf 1, jumps from leaf to leaf in multiples of Aj (Aj, 2Aj, 3Aj). ...
learner's user avatar
  • 85
1 vote
2 answers
89 views

Class for User-defined Binary data type

I have written a program for a user-defined binary data type in JAVA. It has static methods for purposeful usage methods for binary arithmetic methods for bitwise operations It's working as intended,...
Riley Jones's user avatar
0 votes
2 answers
144 views

ContactsList implementation in Java

I created a ContactsList class in Java that holds Person objects. I consider this is a side project for my GitHub profile. Any ...
Hamidur Rahman's user avatar
2 votes
2 answers
4k views

Designing a book library

Description: Design a book library which maintains the book inventory. The library should allow an user to favorite/un-favorite book. The library should allow an user to rent a book for a given ...
CodeYogi's user avatar
  • 5,137
4 votes
3 answers
589 views

Counting votes for candidates in a category and region

With the following code, I want to count the Vote objects from a collection, filtering on one of their fields, Candidate. I have the feeling that I can get this done much more efficiently. ...
mrkflp's user avatar
  • 83
4 votes
2 answers
2k views

Directory JTree Performance

The purpose of this short program is to: Detect all accessible local drives and USB drives List all the accessible directories for each drive which do not require administrator privileges or are ...
Dan's user avatar
  • 385
0 votes
1 answer
61 views

Building object from unusually custom object

Say we have this method which is my main concern for this question. It's really not optimal way to get values out of it. Each time I'm running through list twice for to just get one field value for <...
Amiko's user avatar
  • 141
3 votes
1 answer
84 views

Notifying players about certain events

This class looks ugly as hell to me. I feel like there is a better way but can't really think for a good one. Too many instanceofs and else ifs. What OOP practices or design patterns would you suggest ...
Amiko's user avatar
  • 141
2 votes
1 answer
610 views

Jesse and Cookies

Jesse loves cookies. He wants the sweetness of all his cookies to be greater than value K. To do this, Jesse repeatedly mixes two cookies with the least sweetness. ...
CodeYogi's user avatar
  • 5,137
1 vote
1 answer
122 views

Finding pair in an array with the OO approach

Description: I am trying to solve algorithmic problems mixing them with Object oriented design as part of my interview preparation. So, the question is given an array of integers find the pair of ...
CodeYogi's user avatar
  • 5,137
4 votes
1 answer
271 views

A simple MP3 file arranger

I am creating a simple Mp3 Files Arranger the Project is on Github Questions: How can I optimize this app? Am I violating any OOP principle? Is it readable? How can I make it better? GUI.java ...
Mak's user avatar
  • 291
5 votes
2 answers
6k views

Mars Rover Simulator

Problem Statement Consider a rover and a plateau of size nxn. The rover takes three type of instructions L,R and M. 'L' and 'R' rotate the rover in the left and right direction. 'M' moves the ...
leoOrion's user avatar
  • 387
2 votes
1 answer
881 views

Raindrops in Java

Problem Statement: Write a program that converts a number to a string, the contents of which depends on the number's prime factors. If the number contains 3 as a prime factor, output '...
CodeYogi's user avatar
  • 5,137

15 30 50 per page