shramko82 / stacks Goto Github PK
View Code? Open in Web Editor NEWMy realization of Stack and Deque
My realization of Stack and Deque
I want your data structures to implement iterable interface and also throw some exceptions if invariants are violated (i.e. you try to pop from empty stack).
в твоей реализации стека есть одна серьезная проблема. попробуй найти ее и пофиксить.
чтобы найти ее, возьми tolstoy.txt, возьми свой клиент, и посмотри как приложение расходует память. для этого используй visualvm http://visualvm.java.net/gettingstarted.html
всегда используй кодировку UTF-8 для файлов ! всегда.
final Node<K> f = first;
return unlinkFirst(f);
why not just
return unlinkFirst(first);
Your stack leaks memory and will cause OutOfMemory exception over time.
Please create a client for stack (= a program) that reads a BIG file (I mean like 1 Mb text file) and adds and removes words from this file to stack/deque at random (i.e. read - add - read - add - delete - add - etc. at random)
Please resize stack not when there's no more space but a bit earlier, i.e. when we have more than half (size/2) elements filled, see here for details:
http://algs4.cs.princeton.edu/13stacks/
ты очень странно это делаешь.
зачем нужна переменная isEmptyWord ? :) перепиши с использованием https://docs.oracle.com/javase/7/docs/api/java/util/StringTokenizer.html пожалуйста
Your stack leaks memory and will cause OutOfMemory exception over time.
I just want to write
new Stack < MyObject > () and that's all. No other parameters. No class parameter.
Please implement that.
Please write tests for these collections
ты по ошибке запушил класс файлы, убери их и добавь в .gitignore пожалуйста
Your stack uses fixed size, it's not a real world scenario; please use resizing stack based on array.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.