java - Data structure for continuous additions and cheap deletions -


i reading blog post making animations gnuplot , cairo -terminal algo's plan simply

  • to save png-images working directory, and
  • to save latest video working directory.

i have more such user can browse images real time when images being converted:

data-parallelism model - data structure regularly arranged in array

  • to give user list in interface user can browse arrow buttons
  • in interface, new images being added end of list
  • the user can remove bad images stream in real time

which may work in data parallelism model of parallel programming i.e. data set regularly structured in array. operations (additions, deletions) can operate on data, independently on distinct processes.

let's assume there no need efficient searches simplicity in version 1. however, if come model can also, happy consider - let's call version 2.

i think list not data structure here because of wanted opportunity deletions , continuous easy addition end of data structure. data structure stack not going work either because of deletions. think sort of tree data structure can work because of rather cheap deletions , cheap search there. however, simple array in data-parallelism model can sufficient.

languages

i think java option here because of parallelism. however, language , pseudocode too.

frontend

i have intuition requirements such system in frontend should qt terminal emulator.

what better data structure cheap deletions , continuous additions end?

java linkedlist seems thing use version 1. can use single param add() append list in constant time. if "real-time" mean when image in user's display , pointed somehow, can delete them in constant time well. optimum use of memory , no re-instantiation you'd have arraylist. doubly linked list implemented on objects (as opposed array) do.

your second version isn't clear enough.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -