Katerina198b messenger - #32
Open
Katerina198b wants to merge 2 commits into
Open
Katerina198b wants to merge 2 commits into
Katerina198b wants to merge 2 commits into
Conversation
added 2 commits
March 25, 2016 19:37
Katerina198b
force-pushed
the
Katerina198b-messenger
branch
from
March 25, 2016 16:48
abe6c84 to
d15ae04
Compare
| * Например, Car car = (Car) container.getByName("carBean") | ||
| */ | ||
| public Object getByName(String name) { | ||
| for (Bean currentBean : createdObjects.keySet()) { |
Owner
There was a problem hiding this comment.
Ой-ой! Структура данных хэш-таблица (HashMap) предназначена ля быстрого поиска значений по ключу. Метод get(K key) находит значение, или проверяет, что его нет за O(1). Вы пытаетесь пройти по всем ключам в обход стандартных методов мапы, это говорит о том, что вы не посмотрели, как она работает.
Задание - разобраться в HasMap, материалы есть в блоге. Это основная структура данных.
Object getByName(String name) {
return objByName.get(name);
}
Где-то я уже видел подобный код...
Owner
|
Посмотрел, крупная ошибка по мапе, без задания (4) = 14/18 |
Author
|
Только сегодня увидела Ваш комментарий :-( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1 задание