How can i store data in term of a tree structure

how can i store data in term of a tree structure

What a tree is the question. If you just want a fast access, ehats about Hashtable or dictionary classes ? The data there is structured in a tree. For a simple binary tree, you can use something like
class Node {
Node(Object data){
   Node left;
   Node right;
   Object data = data;
void insert(Object data, Node parent){
  int test = data.compareTo(parent.data);
  if(test < 0 ){
    if(parent.left == null){
      parent.left = new Node(data);
    else{
      insert(data, parent.left);
  else{
    if(parent.right == null){
      parent.right = new Node(data);
    else{
      insert(data,parent.right);
}And so build up a binary tree. The traversing methods can be found in almost any good book (pre-order, post-order, in-order), for search you have just to look at greater/smaller and descend in the tree.
The Object data can be changed to what you want for storage, String, or primitive Numbers, Vectors ...
Is that what you search for?

Similar Messages

  • How can i store data from a pc to TC

    how can I backup data from a PC to TC

    Get a suitable backup software..
    Windows backup is of course useless. But you should already know that. It will not work on any version less than pro anyway.. due to MS deciding people with home versions should never use networks. ???
    That is why there is one million and one third party backup software that do work with network drives. Look up reviews of what works well. for the price you want to pay and get it.. Drive Image was a popular one. I must have a copy somewhere I bought .. then changed to Mac..
    There are plenty of free ones.. I do use macrium reflect.. does disk image only unless you pay the license.. but works super well.. particular for restore.. which people kind of forget.. the value of backup is how well does it restore.
    Use ethernet if possible.
    Note that mixing TM and data on the TC is not necessarily a great idea if you are also running Macs.

  • How can I store data in CompactFlash in a PCI 7041?

    Hi.
    I have built an application for RT control in a PCI 7041 that executes the main loop at 5 kHz, so cycle time is 200 us. Now I want to save some data generated during execution. I would like to register timestamp and three values per cycle so I'd have four values every 200 us.
    I think that the best way to do this is to store data in the CompactFlash memory included in PCI 7041 in real time (one "row" per cycle), and then, after RT loop execution (it lasts about 2 seconds), download all data to Host's hard disk.
    How can I do this? How can I access CompactFlash from Labview? Is there a better way to solve my problem?
    Thanks!

    The 7041's CompactFlash is accessible as a drive (C through LabVIEW's file I/O functions. You can open/create/replace files on the 7041, just as you would on the host by calling file I/O functions in your downloaded VI.
    Once the data is on C:, FTP to the 7041 from the host to retrieve your files. You can FTP programmatically in LabVIEW if you have the internet toolkit. If you don't have the internet toolkit, you can use System Exec to run your FTP commands.
    If you prefer not to use FTP, you can transfer the data via TCP, UDP, or Datasocket, but that will require some additional programming.

  • How can I convert an XML document to a tree structure w/properties?

    I'm working on a way for my config files to use an xml like format where data can be converted into a tree like structure for easy reading (by my program). What I need to do is know how to convert my data. Right now I check character to character looking for an opening bracket which doesn't have a forward slash after it. I copy each character until I come to the closing bracket. Then I start copying each character as the value into a buffer until I come to the closing tag of the opening tag. Then I do searches inward. I set the parent key to be the key of the tag I'm searching in. I don't care for this method myself and it could lead to too many problems. What I'm wondering is if there's a practical way to do this. Is there a way for me to tokenize something like this? Any suggestions?

    something like this? Any suggestions?Yeah. Don't re-invent the wheel. It's pointless.
    I'm pretty sure Apache Jakarta has XML parsers

  • How can i store the data from the list to MS-Access?

    Hi all,
    We all know that from alv it is possible to export data to Ms-excel or word or text file. Can anyone tell me how can i store the data from alv or reports to Ms-Access?
    Thanks in Advance,
    Abhijit

    Hi,
    If you want that without code, i suppose there is a option in MS-Access to import data from Excel, so you have to first export to excel and then import to Access.
    If you want to code it yourself then have a look at FM TABLE_EXPORT_TO_MSACCESS, as said in Exporting Data from R/3 to MS ACCESS
    You can also see the search results in SCN for [export data to MS-Access (45 Results)|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=exportdatato+MS-Access&cat=sdn_all].
    Regards
    Karthik D

  • How can i browse data in my time capsule with my iPhone?

    how can i browse data in my time capsule with my iPhone?

    You might want to take a look at FileBrowser.
    App Store - FileBrowser - Access files on remote computers

  • How can I store my iTunes library on an NAS (Fritz Box)?

    How can I store my iTunes library on an NAS (Fritz Box)?

    1. Drag the library to the external drive, launch iTunes with the Option key held down, click on Choose Library, and point it there.
    2. Get a second. Having the backups on the same drive as the original data won't help when that drive fails.
    (66929)

  • How can we maintain multiple payment terms for a customer

    how can we maintain multiple payment terms for a customer?

    Hi,
    You can leave the Payment terms field in the sales area data tab blank. and you can enter the payment terms at line item level while creating the sales order. By that you will achieve multiple payment terms for the same customer in the same sales order. but the invoice will be split by standard SAP based on the payment terms.
    Also difference between the "Payment Terms" field in Company code tab and the sales Area tab is.
    Company code tab payment terms are used only for the documents that are posted directly in FI module. for example credit and debit memos posted directly in FI and as a leading practice this should always be "payable Immidiately"
    Sales area Tab payment terms are the one which are copied on to the sales order header data which are valid for all the line items unless you specifically mention different payment terms at line item level.
    Regards,
    Shantanu

  • How can i store latitude and longitude (of registered user locations) in sql server and how can i query it for finding locations inside X radius from point y (or any user)?

    Hello
    In my app (WP 8.1) i have to store user location (lat,lon) in sql db so how can i store that location detail? And i also have to find all the location which are inside certain radius X from another user location, How can i do this?
    Any Sample project or code or any blog post?
    P.S. I use sql server 2012.

    If you need to do spatial queries like the one you mentioned you'd need to store it as a spatial geography type. For points, a simple SQL INSERT statement using the Point() method would do it. Example here:
    http://msdn.microsoft.com/en-us/library/bb933811.aspx For locations inside a radius, you'd use STDistance() method. All of the methods for the geography data type are documented here:
    http://msdn.microsoft.com/en-us/library/bb933802.aspx and can be used in ordinary T-SQL statements.
    If you need to use the SQL Server spatial library in your .NET application direct, Alastair has some nice blog posts, like this one:
    https://alastaira.wordpress.com/2011/08/19/spatial-applications-in-windows-azure-redux-including-denali/ , he even wrote a book. Or search the answers in this forum.
    Hope this helps, Bob

  • How can i store bytes array in MS ACCESS???

    Hi,
    i m making small project using Ms Access as a dataBase.
    In which i am encripting some confidential data say ACCOUNT_NAME and storing it into MS Access in encripted form........
    The problem is encripted data is in bytes array n how can i store it into MS access ??? is there any data type similar to BLOB in Ms Access ??
    please help me................
    i had searched net for this but till now not found any useful info :(

    You can try:
    binay type (JET3 255 bytes,JET4 510) Types.BINARY
    ole type (0~1 G) Types.LONVARBINARY
    You can use Text (JET3 255 bytes�CJET4 510bytes) Types.VARCHAR if you use base64 encoding for
    ACCOUNT_NAME column.

  • How can i up date pages on my mac I have osx 10.6.8

    how can i up date pages on my mac I have osx 10.6.8

    To update Pages, open  > Software Update, if you purchased Pages on a DVD, or open the App Store > Updates, if you purchased it from the Mac App Store.
    Note that the most recent Pages only works in Lion or Mountain Lion, so you can install the most recent version for Snow Leopard or the version you have now, If you want the latest Pages '09 version, upgrade to OS X Mountain Lion

  • How can I modify the customer terms of payment?

    Dear Experts,
    How can I modify the customer terms of payment?
    Wilson

    Hi wilson,
      Use this menu path:SPRO->Sales and Distribution>Master data>Business partners>Customers> billing Document-->Define terms of payment.
    Select your terms of payment----> click on magnifing icon and change.
    Save it.
    Thanks,
    Swamy H P

  • Firefox stores my email screen names, how can I store them?

    Firefox stores my email screen names, how can I store them? I had to change the password to one and was suggested to delete it... all I wanted was to change the 'remember password', not delete the screen name

    You can press the Delete key on a highlighted entry in the drop-down list to remove that entry or do the same in the Password Manager.
    *Tools > Options > Security: Passwords: "Saved Passwords" > "Show Passwords"
    If you need to remove saved data then use these steps:
    #Click the (empty) input field on the web page to open the drop down list
    #Highlight an entry in the drop down list
    #Press the Delete key (on Mac: Shift+Delete) to remove it.
    *http://kb.mozillazine.org/Password_Manager
    *https://support.mozilla.com/kb/make-firefox-remember-usernames-and-passwords
    *http://kb.mozillazine.org/Deleting_autocomplete_entries

  • How can i store files from a PC on time capsule

    How can i store files from a PC on Time Capsule

    Actually although the format on the TC is not NTFS but Mac HFS+, that is irrelevant as far as windows is concerned. The TC offers SMB protocol to the network.. so how the TC stores the files is totally irrelevant.
    1. TC is by nature not particularly SMB happy..
    Change all names, TC and wireless to SMB compatible. Short, no spaces, pure alphanumeric.
    Turn on the guest account to read write access.. assuming you don't have security issues.
    Set the workgroup correctly.. don't use wins server.. no body does nowadays.
    Note short no space names.. guest access and workgroup all set.
    2. Download and install airport utility for windows or just bonjour for windows.. bonjour should be included with the full uitlity but that is not necessary.
    3. Just doing the above when bonjour loads it should bring up TC as accessible.. if not, or you need to access it manually.. open windows explorer and type in the address bar.
    \\TCName or \\TCIPaddress .. obviously replacing the generic name with the actual one used. In my case. as per the above screen shot. \\TCGen3
    You will then see the main root directory of the TC.. data or whatever it is named..
    Create a new directory under the root directory for your windows files.. and copy them there.
    Note .. some issues can arise if you are using the TC for TM backups.. Please keep a large enough amount of free space available that TM still works.. pondini recommends using disk images.
    http://pondini.org/TM/TCQ3.html
    As long as you still have plenty of free space this is not an issue but TM may have issues when it fills the drive as it is designed to do.

  • How can we append data in existing flat file

    how can we append data to a existing flat file (Text file).

    just fill the itab from data which suppose to append to text file.than read text file from GUI_UPLOAD and loop on itab and with the use of read statements you may append the data.

Maybe you are looking for

  • Display error after boot

    I'm having an issue where the display fails after boot, and displays only a fixed noise pattern. The screen looks completely normal through POST, GRUB, and when initially loading the kernel, when the display is still in a text mode. After that, the s

  • CS3 doesn't recognize Nikon Raw files in Yosemite

    Since updating to Yosemite on my MacBook Pro, CS3 no longer works properly. Instead of thumbnails, Bridge displays icons for Nikon NEF images. When I click on the icon, I'm told "Could not complete your request because Photoshop does not recognize th

  • Freezing iTunes & won't sync or restore

    So I believe I had just recently updated iTunes to 8.1 and last night when I tried connecting my iPod to my computer it would freeze my iTunes! Sometimes if I just left it, it would tell me I had to restore it, but even when I tried restoring it iTun

  • TS1541 How do I close applications so that I can install new software?

    I am trying to install office:mac but I get the mesage I must close Firefox and safari before I can continue the application installation. I'm stuck! Help. How do I close the applications?

  • IMPOSSIBLE TO cancel subscription

    BE CARE OF THESE PEOPLE. I HAVE NO SUBSCRIPTION, BUT IT KEEPS CHARGING AND THERE IS NO CANCEL BUTTON.