When to use specific data structures

Hi
I'm currently learning Java and have found a wealth of information on data structures (link lists,queues et. al.) but I'm finding not much material on when best to apply specific data structures and the advantages and disadvantages. Could anyone point me to any resources?
Second question as a Java developer do you actually use things like linked lists etc regularly?
Thanks in advance

I suppose that a wealth of information exists because data structures are an integral part of programming. In simpler terms, all that information exists because the answer to question two is yes, absolutley.
The answer to question one is a bit trickier. It's kind of like asking when is best to use a flathead vrs. a phillips screwdriver. The answer seems obvious within a given context, but obscure outside of one.
IMHO: The 'when' becomes clear with experience. Focus on the 'how' and you'll be ready when you are faced with a problem that calls for a particular type of solution.
jch

Similar Messages

  • My network dies when i use cellular data

    Hi guys. I have a problem with my iPhone 4. When I use cellular data, my network die and i have to reset my phone to connect to network again. Anyone experienced this? And i am unable to create personal hotspot.

    my english ***** and i'm sorry for that. i'll try to be more specific.
    i am unable to use 3g, only edge.
    in the moment i activate 3g, my 2g network ( the one i call people and send texts ) dies and instead of operator name in status bar appear Searching... and then No Service. When i stop 3g, my operator is back. i've seen many people with this issue and i'm affraid that my hardware have problems becouse i've just make a complete restore to factory settings and the problem is still there. if anyone know something about this and have a clue, please help . Thank you.

  • Can I automate the creation of a cluster in LabView using the data structure created in an autogenerated .CSV, C header, or XML file?

    Can I automate the creation of a cluster in LabView using the data structure created in an auto generated .CSV, C header, or XML file?  I'm trying to take the data structure defined in one or more of those files listed and have LabView automatically create a cluster with identical structure and data types.  (Ideally, I would like to do this with a C header file only.)  Basically, I'm trying to avoid having to create the cluster by hand, as the number of cluster elements could be very large. I've looked into EasyXML and contacted the rep for the add-on.  Unfortunately, this capability has not been created yet.  Has anyone done something like this before? Thanks in advance for the help.  
    Message Edited by PhilipJoeP on 04-29-2009 04:54 PM
    Solved!
    Go to Solution.

    smercurio_fc wrote:
    Is this something you're trying to do at runtime? Clusters are fixed data structures so you can't change them programmatically. Or, are you just trying to create some typedef cluster controls so that you can use them for coding? What would your clusters basically look like? Perhaps another way of holding the information like an array of variants?
    You can try LabVIEW scripting, though be aware that this is not supported by NI. 
     Wow!  Thanks for the quick response!  We would use this cluster as a fixed data structure.  No need to change the structure during runtime.  The cluster would be a cluster of clusters with multiple levels.  There would be not pattern as to how deep these levels would go, or how many elements would be in each.   Here is the application.  I would like to be able to autocode a Simulink model file into a DLL.  The model DLL would accept a Simulink bus object of a certain data structure (bus of buses), pick out which elements of the bus is needed for the model calculation, and then pass the bus object.  I then will take the DLL file and use the DLL VI block to pass a cluster into the DLL block (with identical structure as the bus in Simulink).  To save time, I would like to auto generate the C header file using Simulink to define the bus structure and then have LabView read that header file and create the cluster automatically.   Right now I can do everything but the auto creation of the cluster.  I can manually build the cluster to match the Simulink model bus structure and it runs fine.  But this is only for an example model with a small structure.  Need to make the cluster creation automated so it can handle large structures with minimal brute force. Thanks!  

  • Time is delayed by 10 minutes when you use Automatically Date & Time

    Time is delayed by 10 minutes when you use Automatically Date & Time in France

    It is not carrier as all my Apple products where up to 10 minutes fast. I had to reset each product to the correct time. I'm in New Zealand.

  • I am using iphone 5C when I use to data cable to charge it from my laptop I always get an error message saying 'Power Surge on hub port'. I am not able to charge my iphone

    I am using iphone 5C when I use to data cable to charge it from my laptop I always get an error message saying 'Power Surge on hub port'. I am not able to charge my iphone at all. Please help

    I have read that usb hubs usually have only 1 port at a high enough watts = volts x amps iPads need 10watt = 5v x 2 amps so when you use more devices it may share the power so I would buy a usb charger with 2+ amp ports if you want to just charge your devices the computer hub are not designed for that just communication

  • Odbc Driver error when using specific date column

    I am receiving the this error:
    Odbc driver returned an error (SQLExecDirectW).
    Error DetailsError Codes: OPR4ONWY:U9IM8TAC:OI2DL65P State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 46036] Internal Assertion: Condition len <= desc->objectLength_, file ..\Oci8\Src\SQXDGOci8.cpp, line 614. (HY000)
    It happens when I try to to set criteria on a specific date column or I do not set criteria at all. If I set date column 1 to greater than 4 or so months back the report returns, along with all the dates from date column 2. But if I then try to set date column 2 as the criteria, no matter if I just ask for data from a week until today, I receive this error. I tried changing the Server Stack size to 512, but that did not help. Anyone have an idea on this???

    You seem to be using an ODBC connection with an Oracle database, is that correct? If so you should install the Oracle client and use the OCI driver instead and it is much faster and stable than ODBC.

  • Issue found in EHS in using specification data import using  process

    Dear EHS community
    Now using EHS classic for a long time a issue has been detected in EHS standard import. During maintenance of EHS data normally using CG02 the system is always using the default "Data origin" specified in customizing to be stored in EHS tables (e.g. ESTRH, ESTRI etc.). In standard process to import specification data one can define a different "Data origin". Now we are using an import file with default" data origin and executed the import. Now a strange effect has been detected (and not always) for update of identifiers. For the import purpose you must nominate at least one identifier. If the identifier is found then normally no update happens but only the value assignment data is inserted (or updated). If the identifier is not found it get be inserted on spec level in ESTRI. Now during the update the "Data origin" of the identifier present in the system (and which matched to identifier on file level) was changed but not the identifier as such. Any data record on value assignment level received the defautl data origin. Actually there is no explanation for this behaviour. If Default "Data origin" would be "SAP" (as the term) this value has been change to "Space". Any explanation of this effect is appreciated (or and idea regarding that).
    C.B.
    PS: analysis of change logs in EHS etc. executed so far clearly indictae that an "Update" happened on the identifier; but only the field SRSID is effected; EHS import is quite old and therefore very stable;
    PPS: I found a thread taking about the import file:
    spec import_inheritance data
    Example shown thre is like:
    +BS
    +BV   $ESTRH
    SRSID                          EH&S
    SUBID                          000000385000
    SUBCAT                         REAL_SUB
    AUTHGRP                        EHS_PS
    +EV
    +BV   $ESTRI
    SRSID                          EH&S
    IDTYPE                         NAM
    IDCAT                          EHS_OLD
    IDENT                          XY0002
    ORD                            0001
    +EV
    +BV   SAP_EHS_1013_001
    $ESTVA-SRSID                   EH&S
    SAP_EHS_1013_001_VALUE         N09.00101280
    +EV
    If you compare SAP helpt normally only at the"begining pof the file you will find "SRSID" Here this field is nominated often. On Level of ESTRH as well as ESTRI.
    PPS: e.g. refer to: TCG56 EHS: Data Origin - SAP Table - ABAP

    Dear Ralph
    first thanks for feedback. Regarding content provider: we need to check that on deeper level
    Regarding import may be my explanation was not good enough.
    Imagine this case:
    you have a specification in the system there you would like to add e.g. denisity data.. To do so you need at least one identifier which you must nominate during the import. As long as this identifier is "identical" in system and in the file this identifier should not be "changed/effected" etc. and only the additional data should be loaded, This was the process we used. Now we detected that this seems not to be the real effect. The identifier as part of the file is "updated" in EH&S. In the example above somebody used this logic:
    +BV   $ESTRI
    SRSID                          EH&S
    IDTYPE                         NAM
    IDCAT                          EHS_OLD
    IDENT                          XY0002
    ORD                            0001
    +EV
    Nearly the same is used in our process. Only difference ist, that we do not define the "SRSID". The same is true for any other data in the file. SRSID is nether specified.
    What is happing now:
    e.g. the "density" data is added with SRSID "EH&S". This effect is "normal". As by default SRSID should be EH&S (as this is defined as such in customizing) and because of the fact that at the top the ID is es well "EH&S". In the system we have the "XY0002" having SRSID EH&S. By using now this upload approach the only difference afterwards is tht kin th systeM; XY0002 does get "blank" as SRSID (and there is no data origin "blank" defined. Up to today my unertsanding was clearly: no update should happen in the identifier. This seems not to be the case. Is my understanding here different? Or is this SRSID in the load file is really mandatory in ESTRI level to avoid this effect. I hope that you can provide some feedback regarding this.
    C.B.
    PS: referring to: Example: Transfer File for Specifications - Basic Data and Tools (EHS-BD) - SAP Library
    The header of import file should look like:
    Comment
    +C
    Administrative section
    Character standard
    +SC
    ISO-R/3
    Identification (database name)
    +ID
    IUCLID
    Format version
    +V
    2.21
    Export date
    +D
    19960304
    Key date for export
    +VD
    19960304
    Set languages for export
    +SL
    E
    Date format
    +DF
    DD.MM.YYYY
    IN our case +ID = EH&S (as this is the value in export file)
    IN this example this additional one is shown:
    Begin table
    +BV
    $ESTRI
      Table field
    IDTYPE
    NAM
      Table field
    IDCAT
    IUPAC
      Table field
    IDENT
    anisole
      Table field
    LANGU
    E
      Table field
    OWNID
    ID1
    Therefore no SRSID is specified. And this is the data in our file (on high level) and the "only" change is that the identifer get "deleted" the SRSID

  • Importing Excel files and using a search function to use specific data based on user selection

    Hi, I'm trying to create a search and solve function within Visual Basic.
    I want to use the combustion equation C8H18 + 20(O2 + 3.76 N2) = 8 CO2 + 9H20 + 47 N2 to determine flame temperature using
    9*Hf of C02 + 8 * Hf H20 + 47 Hf N2 = Hf C8H18
    I have all of the values of Hf in an excel spreadsheet but I want to be able to search the spreadsheet as my application requires the user to change to fuel (the C8H18 bit) which changes the value of Hf.
    Is there a way of searching that excel file each time I run my program?
    Thanks
    Jack

    Thanks for answering so quickly.
    I've used that method before, and I'm sorry I didn't specify. 
    This will be used as a student learning aid and so the application itself and the tables will be downloaded as a zip file and so I don't believe the line below would work?
    I've heard about including excel as a reference file in the application but I haven't been able to find any further information on that.
    Thanks again
    Dim oWBa As Excel.Workbook = oApp.Workbooks.Open("C:\Users\v-youtan\Desktop\colleagues.xlsx")"

  • Implement a program by using data structure

    i've learn link-list,b-tree,red black tree,hash table. now it's time for me to implement a program using any one of these. i've no idea about how to start, and what kind of program should i write? what kind of program use data structure? i want some simple example program to make me understand. can anyone help me?
    thank 4 u r time,
    makio

    what sort of program do use data structure? let's say
    i want to use binary search on data , how can i?As nasch said: pretty much any program uses data structures.
    Okay, let's say you want to try binary search. You could do that on an array, on a singly linked list, on a doubly linked list, probably on others that I can't think of right now.
    If you just want practice using the data structures you've learned, then why not write a binary search over several different ones? That will give you a feel for how they differ in usage and performance.
    Or, you can just pick any kind of program that interests you. Unless it's trivially small and simple, there will probably be a use for one or more of the data strux you've learned.
    A chat program needs data structures to hold curently connected users, ongoing conversations, maybe a queue for messages waiting to be sent.
    A card game needs to be able to search to see if a given card is in a given hand. Needs to hold all the cards in a deck that has to be shuffled. Dealing is like popping off a stack.
    A database of students and their courses might want to keep something in an ordered tree--by last name for instance.
    What applications interest you?

  • Using a single data structure in a desktop application

    Hello,
    I am programming an application that needs to constantly access a data structure, for instance to add / edit / update / search data. Several graphical user interfaces need to modify this data structure. I was wondering of easy ways to use the data structure throught the whole application. One solution I found was to use the singleton pattern for my data structure, though lots of people have recommended me to avoid using that pattern. What are better ways of accessing that single data structure from all of those GUIs ?
    Thank you,
    Alfredo

    Not that there is anything wrong with a Singleton pattern, but I don't see how it would help you in this case.
    Just create the DataStructure and let every GUI that need to use it have a reference to it.

  • Complex data structure.

    Hi,
    This is a design issue that I have run into many times and I was wondering how you all solve it. When using complex data structures (such as array of clusters, or clusters containg arrays and/or other clusters), I have found that there are many situations where you need to wire either an "empty" stucture or the type of the structure as an input. For example, when building up the data structure, I often use shift registers, and need an empty data structure to initialize the shift register. Also when bundling a cluster by name you need the type of the cluster. My question is - what do you use in these situations? Of course, I always typedef my complex structures, and I know that there is a default value for them, because other language featu
    res depend on there being a default. Is there anyway to get the default value for a typedef? Not seeing one, I have taken to creating a Global or Dummy VI for each typedef that returns a default data structure, which is what I use in all these situations. What other approaches have you seen?

    > of the cluster. My question is - what do you use in these situations?
    > Of course, I always typedef my complex structures, and I know that
    > there is a default value for them, because other language features
    > depend on there being a default. Is there anyway to get the default
    > value for a typedef? Not seeing one, I have taken to creating a Global
    > or Dummy VI for each typedef that returns a default data structure,
    > which is what I use in all these situations. What other approaches
    > have you seen?
    You can right click on a wire or terminal and create a constant for the
    type already there. This will sometimes fool you if you are wanting the
    input to a shift register since the types flow downstream and you want
    upstream. Just click somewhere whe
    re the type is known, create the
    const and move it where you want it.
    The BIG downside to this is that typedef constants tend to be BIG. My
    favorite solution is to make a subVI that returns the default for the
    typedef. Put it in user.lib and it is readily accessible. You can
    think of it as a constructor for your datatype, if you want. In fact
    you can make several of these or parameterize it to return different
    flavors. Being the size of all other icons, it fits nicely into the
    diagram and adapts to typedef changes.
    Greg McKaskle

  • My iPhone 5 battery drain with in 3 hours when I use cellular network on and stand by time is only 2 and half day

    I Bought iphone 5 from USA  when I came to India I started it then I noticed the battery stand by time is only 3 days. And when I use cellular data then it is live only for 2 and half hour. I bought this phone in January till now I am having the same problem. I have done all the thing whatever the support center told me about restore and all stuff. After that they told me to visit any apple store but there are no store in India and I'm helpless. For my iPhone only I can't go abroad to that country where stores are. Before I used to believe that apple products are the best but this iPhone has just disappointed me. You know my friend making fun of my mobile because they are using samsung product.
    Pleade do some thing for me I have left only 2 month of warranty. other wise I will have to through this on dustbin because everywhere it is insulting me.

    Sorry, but the warranty for the iPhone is only valid in the country where you bought the device.
    In most of the cases 3rd party apps or settings caused the battery to drain faster than before the new software has been set up. Sometimes the mail app tried to connect to the mail server over and over again, deleting and setting up the mail account can solve this problem.
    In other cases social media apps did similar things to the phone.
    Here are some suggestions for getting back the normal battery life, maybe they are helpful for your problem with your iPhone 5 as well.
    iPhone 4S battery life problems SOLVED
    Check the links provided by Texas Mac Man in this post about battery life:
    https://discussions.apple.com/thread/3935221
    iOS 6 iPhone 4s battery drain

  • Issue with using formatted date value column in order by clause...

    Hi,
    1) Through a function I am listing all the months in a year.
    like JAN-2007, FEB-2007,MAR-2007......
    2) i am comparing these values against a date value column in a table.
    And if there are no values in a particular period it will return a null value (simply to say, i am using an outer join)
    3) The issue.....
    When join both the queries then the order of the dates is not mainted .....
    My requirement is......
    Jan-2007 = 3
    Feb-2007 = 5
    Mar-2007 = null
    etc.....
    should be acheived.
    But I end up in the alphabetical order of the months....
    like
    Apr-2007 = 5
    Aug-2007 = 10
    etc.....
    Can anybody let me know how can i acheive my resultant output to be ordered by the date and not by character.
    When I use the date column in the order by I run into an error....
    saying....
    ORA-01858: a non-numeric character was found where a numeric was expected
    Its a kind of urgent...
    Any help is appreciated....
    KK

    When I use a outer join as follows....
    "and upper(to_char(a.task_planned_start_date,'mon-rrrr')) = d.period_name(+)"
    All the null periods are ending at the bottom.It's standard behavoiur.
    Seems, you need to sort by a.task_planned_start_date.
    Look below:
    SQL> select e.ename, ec.ename from emp e, emp_copy ec
      2  where e.empno = ec.empno(+);
    ENAME      ENAME
    SMITH      SMITH
    ALLEN
    WARD       WARD
    JONES
    MARTIN     MARTIN
    BLAKE
    CLARK      CLARK
    SCOTT
    KING       KING
    TURNER
    ADAMS      ADAMS
    JAMES
    FORD       FORD
    MILLER
    14 rows selected.
    SQL> select e.ename, ec.ename from emp e, emp_copy ec
      2  where e.empno = ec.empno(+)
      3  order by ec.ename
      4  /
    ENAME      ENAME
    ADAMS      ADAMS
    CLARK      CLARK
    FORD       FORD
    KING       KING
    MARTIN     MARTIN
    SMITH      SMITH
    WARD       WARD
    JAMES
    TURNER
    ALLEN
    MILLER
    BLAKE
    JONES
    SCOTT
    14 rows selected.
    SQL> select e.ename, ec.ename from emp e, emp_copy ec
      2  where e.empno = ec.empno(+)
      3  order by e.ename
      4  /
    ENAME      ENAME
    ADAMS      ADAMS
    ALLEN
    BLAKE
    CLARK      CLARK
    FORD       FORD
    JAMES
    JONES
    KING       KING
    MARTIN     MARTIN
    MILLER
    SCOTT
    SMITH      SMITH
    TURNER
    WARD       WARD
    14 rows selected.Rgds.

  • SAP ABAP Proxy - recursive data structure problem

    Hi,
    For our customer we try to bind SAP with GW Calendar using GW Web Services. We tried to generate ABAP Proxy from groupwise.wsdl file but there are problems: GW uses recursive data structures what ABAP Proxy can not use. Is there any simple solution to this problem?
    Best regards
    Pawel

    At least I don't have a clue about ABAP Proxy.
    You are pretty much on your own unless someone
    else has tried it.
    Preston
    >>> On Tuesday, August 03, 2010 at 8:26 AM,
    pawelnowicki<[email protected]> wrote:
    > Hi,
    >
    > For our customer we try to bind SAP with GW Calendar using GW Web
    > Services. We tried to generate ABAP Proxy from groupwise.wsdl file but
    > there are problems: GW uses recursive data structures what ABAP Proxy
    > can not use. Is there any simple solution to this problem?
    >
    > Best regards
    > Pawel

  • Looking for suitable and robust data structure?

    I have an application where i have to give user an option to correlate the
    response returned by a method call with other methods arguments.
    I have provided a jtree struture where user can see methods and their
    responses and can correlate them by selecting appropriate arguments
    where these values could be used.
    I used a data structure to store such relations like
    A hashmap where every key is a unique number representing method number
    and value ia a matrix.
    In each matrix, the first element of every row would be the Response object and
    all remaining elments in the row would be Argument objects. :)
    Now maybe someone would ask, for every method there is always only one return type
    then why such a matrix with Reponse object as first element of each row.
    The reason is that i gave user an option to not only relate response as a whole Object to
    different arguments of different methods but user can select a field of this response object if this
    is a complex type or user can select any element if the response is a Collection object to relate
    with arguments.
    I am not sure whether this structure is more appropriate or i can use more robust
    and memory efficient structure.
    Please give me your useful suggestions.

    J2EER wrote:
    I have an application where i have to give user an option to correlate the
    response returned by a method call with other methods arguments.I really don't understand you.
    I have provided a jtree struture where user can see methods and their
    responses and can correlate them by selecting appropriate arguments
    where these values could be used.Huh?
    I used a data structure to store such relations likeErr, what happened to the rest of your sentence? Or is the next part the rest of it?
    A hashmap where every key is a unique number representing method number
    and value ia a matrix.Where does this matrix come from? In my book, a matrix is a 2 dimensional structure. What do you mean by it?
    In each matrix, the first element of every row would be the Response object and
    all remaining elments in the row would be Argument objects. :)
    Now maybe someone would ask, for every method there is always only one return type
    then why such a matrix with Reponse object as first element of each row.You're still talking about methods? If so, don't all methods have just one return type?
    The reason is that i gave user an option to not only relate response as a whole Object to
    different arguments of different methods but user can select a field of this response object if this
    is a complex type or user can select any element if the response is a Collection object to relate
    with arguments.
    I am not sure whether this structure is more appropriate or i can use more robust
    and memory efficient structure.
    Please give me your useful suggestions.Perhaps you could give a more detailed explanation and more importantly, provide some examples of what you mean.

Maybe you are looking for

  • Exchange 2013 SP1 Setup fails

    I am getting very frustrated. It really shouldn't take over a week to install Exchange. I have two domain controllers, Windows 2003 and Windows 2008 R2. The 2008 is now all Operations Masters for all roles. I have a clean install of W2K8 R2 SP1 insta

  • File Batching in OSB

    Hi , I have a requirement in OSB project where I need to merge files before sending it to target application. For some reason we prefer not to maintain either queue/directory/file server to save incoming files. Target application will poll the final

  • How to view DB schema in SAP B1 company

    Hi, Would you please tell me how to view Company database schema. When I use Database browser It gives Exception as "B1DBBrowser ERROR: The Type initializer for 'B1wizard.Globals'" threw an Exception. Thank you Buddhika

  • View Enterprise manager in 10.1.2.0.1

    Hi All as we used to browse database using Oracle Enterprise manager for 10g database how can we do that is there a URL ?? kedar

  • Are there serious bugs with SUN one studio

    sometimes when I an trying to perform some particular type of operations in SUN one studio community edition on my pentium III 600MHz 256MB RAM system, SUN one studio vapourises from the deskop even faser than it does when u exit normally, i changed