Data Structures and Algorithms in java book

Hi guys,
I want to know a good book which is good for Data Structures and Algorithms in java. I am good at Core java but a beginner for Data Structures in Java. I am a little poor in Data Structures concepts.
Following are the books I have found on the net. Could you help me the choose the best outta them.
1. Data Structures and Algorithms in Java - Mitchell Waite
2. Data Structures in Java - Sandra Anderson
3. Fundamentals of OOP and Data Structures in Java - Richard Weiner & Lewis J. Pinson
4. Object Oriented Data Structures Using Java - Nell Dale, Daniel T. Joyce, Chip Weems

lieni wrote:
I good data structures book doesn't have to be language-specific.Thx DrLazlo, my speachYes.
The OP wrote:
I have access to these books and dont know which one to start with.What I meant is that you shouldn't narrow your search to insist that the book you choose have "Java" in the title.

Similar Messages

  • Need links for data structure and algorithms.

    Hi.
    I am just new to java but need to learn data structure and algorithms.
    Do your guys got any good links or bbs to learn?
    Thanx in advance

    http://www.amazon.com/exec/obidos/tg/detail/-/1571690956/ref=cm_huw_sim_1_3/104-7657019-1043968?v=glance
    http://www.amazon.com/exec/obidos/tg/detail/-/0534376681/ref=cm_huw_sim_1_4/104-7657019-1043968?v=glance
    http://www.amazon.com/exec/obidos/tg/detail/-/0672324539/ref=cm_huw_sim_1_2/104-7657019-1043968?v=glance
    http://www.amazon.com/exec/obidos/tg/detail/-/0201775786/qid=1060946080/sr=8-1/ref=sr_8_1/104-7657019-1043968?v=glance&s=books&n=507846
    $8 for the first

  • Wandering data structure and database infrastructure

    1, what do I need to do for building a new data structure?
    2, what do I need to do for building a database infrastructure?

    The questions still, unfortunately, don't make sense.
    The first question is at least starting to coalesce into something answerable. I'm guessing that the first question is about data modeling but in order to make that guess, I have to assume that they're not talking about a "data structure" and that they mean to be talking about an application. If question 1 is really asking to describe a situation where your friend had to design a data model, the answer, presumably, would be to describe a situation where your friend had to design a data model. The interviewer would almost certainly have followup questions about how the data model was designed, why particular design decisions were made, etc. depending on the data model your friend started describing.
    The second question still isn't close to answerable-- it is far from clear what is being asked.
    Justin

  • Looking for an efficient data structur & search algorithm

    Hi all
    i have a list of digits (international phone network prefixes) with some hundreds to some thousends entries. An entry may be in the form
    ^00[1-9]{1}[0-9]{0,7}$
    I.e. this might be 001, 0041, 00317545, 00317548, 00317549 and so on. Regarding the last three examples, it might even be that there is an additonal 0031754.
    What i need a a data structur that allows to match these prefixes against a phonenumber.
    I.e. if i have the phonennumber 001123456789 it would match the prefix 001. If i had 00317549111 it would match 00317549.
    The easiest way would be to but all prefixes into an Vector or similar and loop over all entries, trying to match the phonenumber with startsWith(). But this wouldn't always result in a absolutely perfect match, since, i.e. for the phonenumber 00317549111 the check against the prefix 0031754 would return a match even if there was a more specific match with the prefix 00317549. But more than that, this simple algorithm is not very efficient.
    So i am looking for a more efficient way/pattern to do this. I thought about a kind of tree structure, starting with 00 in the top level, than provding [1-9] in the second level, and [0-9] from third level on. Then on every node it would either store if there is a matching prefix on that level, or if there is a prefix starting with that digits on a lower level or if there is no prefix on that level or any lower.
    I.e. when i have the phonenumber 00317549111 it would start at the top level with 00. That would be ok. On the next level it would check if there is a node for digit 3. If there is, it would go one level deeper and check if there is a node for digit 1. If yes, again it would go one level deeper to check if there is a node for digit 7. If that algorithm comes to a level where, for the request digit, it get's a prefix indicator rather than a node indicator, the algortihm would know, that a matching prefix was found and that there is no more specifig match on deeper levels.
    One thing i forgot to mention - the prefixes might be read once during startup/init and there it might take some time for building up the datastructur - i don't care about that. But, when running, then the maching process should be as efficient as possible, that's the most important point for me.
    What do you think about a pattern like this? Could this be efficient? Do you see other patterns, that might be easier to implement and that might be faster/need less memory?
    Thanks a lot for your help.
    Cheers, Frank

    I would really have gone for your first approach. With mperemsky5's approach you have the loop with (potential) n iterations (Let n be the length of the number) and in each iteration to compute the hash-code for the string which again takes time proportional to the strings length.
    The tree approach takes time equal to the length of the prefix and is imho not more complicated.
    Perhaps this way:
    public class DigitTree
      private class Node {
           private Object content;
           private Node[] children = new Node[10];
      private Node root = new Node();
      public DigitTree() {
      public void addPrefix(String prefix, Object value) {
           char[] numberChars = prefix.toCharArray();
           Node node = root;
           for (int i=0; i<numberChars.length; i++) {
                int number = numberChars[i] - '0';
                if (node.children[number] == null) node.children[number] = new Node();
                node = node.children[number];
           node.content = value;
      public Object match(String phonenumber) {
           char[] numberChars = prefix.toCharArray();
           Node node = root;
           for (int i=0; i<numberChars.length; i++) {
                int number = numberChars[i] - '0';
                if (node.children[number] == null) return code.content;
                node = node.children[number];
           return node.content;
    }The method addPrefix lets you add a prefix to the tree. The content-Object can hold a String or whatever to identify the prefix. If your data is not complete (i.e. if there are numbers for which no prefix exists) you might want to initialize the content-object of a node with a default value (e.g. "not found").
    The method match lets you look up a prefix for a given number and returns the Object associated with the prefix..
    The code was not tested.
    Greetings
    Thomas

  • Data Type and Algorithm

    I require some help with the line intersection algorithm in PL SQl
    I have worked with it on C programs, but not to sure how to create type and variables in PL SQL
    I have written the code for the algorithm, i require help to create the data types and testing the algorithm.
    I not too sure if my declares variables which will be data type number are correct
    ( x1, y1, x2, y2, x3, y3, x4, y4,xc, yc;
    --a1, a2, b1, b2, c1, c2; /* Coefficients of line eqns. */
    -- lr1, r2, r3, r4; /* 'Sign' values */
    -- denom, num; /* Intermediate values */
    -- Bsign and Asign will have to be type boolean
    Create or Replace type Intersect_point object
    ( x1 number, x2 number, y1 number, y2 number, x3 number, y3 number, x4 number, y4 number, xc number, yc number,
    a1 number, a2 number, b1 number, b2 number, c1 number, c2 number, r1 number, r2 number, r3 number, r4 number,
    demon number, num number,
    Bsign boolean, Asign boolean)
    create or replace type body box as
    a1:=y2-y1;
    b1:=x1-x2;
    c1:=x2*y1-x1*y2;
    r3:= a1*x3+b1*y3+c1;
    r4:= a1*x4+b1*y4+c1;
    asign:=r3<0;
    bsign:=r4<0;
    if ( (r3!=0) and (r4!=0) and (asign = bsign) ) then
    return 'False';
    -- /* Check signs of r3 and r4. If both point 3 and point 4 lie on
    -- * same side of line 1, the line segments do not intersect.
    else
    a2:= y4-y3;
    b2:= x3-x4;
    c2:= x4*y3-x3*y4;
    r1:=a2*x1+b2*y1+c2;
    r2:=a2*x2+b2*y2+c2;
    asign:=r1<0;
    bsign:=r2<0;
    if (r1 != 0) and (r2 != 0) and (asign =bsign) then
    return 'False';
    /* Check signs of r1 and r2. If both point 1 and point 2 lie
    * on same side of second line segment, the line segments do
    * not intersect.
    else
    denom :=a1*b2-a2*b1;
    if(denom=0) then
    return 'NULL';
    --they are collinear
    else
    num:=b1*c2-b2*c1;
    xc:= num/denom;
    xc:=a2*c1-a1*c2;
    yc:= num/denom;
    return 'True';
    ---- This shows they intersect. HOW can i code to get output for
    --intersection points xc yx?
    end if;
    end if;
    end if;

    Hi
    Can you tell me the your requirement (i.e) incoming receipts and outgoing payments will be cleared (i.e on what basis).
    Thanks
    balu

  • I have created a database, what is data structure and relationship?

    I have a database.
    I have 4 tables.
    Employee table
    Project Table
    Sales order table
    Customer table
    ================================
    SalesOrderId is unique
    EmploeeId Is unique
    CustomerID is unique
    ProjectId is unique
    What would be the relationship for these tables?
    Should I create 5th table that has salesOrderID and ProjectID and the primary key is the combination of salesOrderId and ProjectId?
    Is the whole process correct?
    Regards,
    GGGGGNNNNN
    GGGGGNNNNN

    . IDENTITY is never part of a valid data model and certainly not  a key.
    Identity can be a primary key, can't it be?
    It can be. What Celko is trying to say is that IDENTITY is not a good choice for a key. Unfortunately, he is sitting in an ivory tower and does not have very good ideas of real-world systems.
    More generally, when you design a database, you may decide to introduce a
    surrogate key in your tables. That is, a key which is not drawn from the data, but just generated in the system. Ideally, you should still have a real key in the data. The reason you would use the surrogate key is that the real key may be difficult to
    work with, for instance it is a long string or consists of many components.
    In practice, far from all entities can (easily) be described with a natural key, why the surrogate key is the only one you will have. However, you should always strive for finding a natural key, and not slap on IDENTITY as a matter of routine. For instance,
    say that you have a table called ProductCategories which defines which categories a product belongs to, that table should have a two-column of ProductID and CategoryID, and there should not be any IDENTITY column in that table.
    Generally, when I see people post a table table definition with an IDENTITY column and all other columns nullable, I know that they have not put in enough thought to their data-modelling.
    And, no, surrogate key != IDENTITY. IDENTITY is one way to implement surrogate keys, but you can also use guids, sequences (in SQL 2012 and up) or roll your own. Since IDENTITY incurs some limitations, you may want to avoid it. Sequences are cleaner and
    you don't have the same limitations. And rolling your own works very well, as long as you don't expect a high level of parallel inserts, which is what IDENTITY and sequences really are aimed for.
    We never put audit data in the table under audit. It is not just silly, it is illegal.
    What do you mean?
    Again, Celko is out of touch with reality. It may be illegal in Texas where he is sitting but not where you and I are sitting. It may also be illegal if the auditing is made for legal reasons. Obviously, if the auditing is mainly done to facilitate troubleshooting,
    your local law-enforcing authorities could not care less.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Data structure and out of memory error

    I have a program need to load data files and store the float data values in 3 two dimentional array. These data files are generated from biological experiments and are quite large. For e.g., when I tried to load 59 files, each file has 409,600 rows and store these data in 3 Float[][] arrays, like following
    pixel: Float[59][409600]
    signal: Float[59][409600]
    std: Float[59][409600]
    I know the variables of float data type occupy 4 bytes in memory, is this true for the object of Float data type(the wrapper class for float)?
    After cacluation, the total memory needed for the three 2D arrays are:
    4 * 409600 * 59 * 3 = 276.6 (MB)
    I'm using JBuilder 9 Personel and already set the parameter of -XmX as 800 MB, but I still get out of memory error in the middle of loading. Could you give a hand on this issue?
    thanks a lot!

    ok, you mean the Float object will take 24 bytes to
    store in memory instead of 4 bytes needed for float
    variable, right?Yes it's about 20 bytes per Float object. 4 for the actual float and about 16 in overhead. And then 4 bytes for the reference to the object in the array. So each float will occupy a total of about 24 bytes whereas a float just takes 4.
    Would you please give me a clue where
    you get this information?Well an object stores the actual data and has an overhead of about 16 bytes so it's just to add it up -:) I use this as a rule of thumb. I don't remember anymore where I got it in the first place.
    The purpose to store in
    Float object is to display these data directly in
    JTable to reduce the overhead for displaying data in
    table.Yes but it's better to minimize the storage of the raw bulk data. You can always have getter methods that return Float objects to the rest of the program "on demand".
    I've a class to create the table model by
    subclassing the AbstractTableModel. Based on these
    loaded raw data, I've to do other expensive operation
    using different analysis methods. So maybe using the
    built in data type is more effcient in my later
    calcuations.It's always a tradeoff. Use float for fast calculations and raw storage, and Float otherwise for maximum object orientation.

  • Multiple Data Sources and Accessing External Java APIs

    Hi Everyone,
    I have a couple of questions for which I was not able to find satisfactory answers in the forum search, so here they are. I would be really grateful if you can help us out with this.
    1. Accessing two Data Sources in the same report: We have a requirement to access two data sources in the same report, and use the data from one source to run a query on the other source. Our product (OIM) has its own DB. And it integrates with BPEL (another Oracle application) for some functionality. BPEL has its own DB. A few reports need data from both these repositories. For simplicity, consider that we need to join two tables, but one table is in OIM DB and the other is in BPEL DB. I guess such a join is not possible. So to work around it, we would like to run a query against one DB and then use the results to run a query on the other DB, which will basically simulate the join by running two queries.
    Is something like this possible in BIP? If not directly available, can you suggest something which can act as a work around to achieve this?
    2. Calling External Java APIs from BIP: We need to call some external APIs (for achieving Data Security) 'before' we run the queries in BIP. Basically the Java API will specifya set of keys which will have to be used in an 'in' clause. I looked at the section "Building a Data Template" in the BIP User's Guide (http://bipublisher.us.oracle.com/doc/prod_docs/BI_Publisher_10_1_3_3_3/bip.1013/b40017/T421739T434255.htm). As far as I can see, it discusses how to invoke a PL/SQL procedure using <datatrigger> but the usage is not clear to me. Is there any other document that discusses this in detail? Also, I am not sure if it is possible to access Java APIs. Has it been done before? If yes, then can anyone provide some sample code (sample report bits) which I can refer to to get this thing working?
    Also, the data coming from the Java API may not be in the correct format. We may have to do some additional processing (like converting data in a Java Object to something like comma separated list to be plugged into a query). Is that possible? What will be the best approach here?
    Sorry for the detailed post!
    Thanks,
    Jatan

    Yes you should be able to use both - for example using a Flash Variable to pass in the URL of the XML that you want to load.
    FlashVars are only supposed to be passed in on startup and they are defined as part of the OBJECT/EMBED tag for the HTML.
    Actually it was possible to update FlashVars at runtime in Xcelsius 4.5 with certain JavaScript calls but not in Xcelsius 2008 (because Adobe Flex which Xcelsius 2008 is based on does not allow the same mechanism).
    FYI, for those that are interested in Xcelsius 2008 you pass values into/out of Xcelsius at runtime using External Interface and JavaScript instead.
    Regards,
    Matt

  • Java Data Structures Book

    Hi all, I'm looking for a Data Structures and Algorithmitmics book in Java with the answers to many of the exercises.
    Any idea?
    Thanks

    Hi all, I'm looking for a Data Structures and Algorithmitmics
    book in Java with the answers to many of the exercises."Data Structures and Algorithmitmics book in Java " seems like a pretty generic name. Who is the author?
    If the book is used for a university course, the publisher may only sell the answer book to authorized clients, e.g. the university bookstore. So you would have to ask them, but then they will ask if the request is on behalf of the professor. If you said you were a graduate student and a TA for the course, and on request from the professor you are asking to place an order, and to email/call you to pick it up for the professor then you might be able to get a copy. Or you could ask the professor for a letter and explain to him that you really need a copy of the answers. However, if the questions in the book are used as part of the grading questions, there is very little chance.
    You could also try searching online, or ask the TA for help. In my experience, TAs have 1 or 2 hours a week where anyone can drop in and ask questions. Take advantage of that.
    then you might be a

  • Relationship between Dynamic Memory Heap and Heap Data Structure

    This question is not strictly related to Java, but rather to programming in general, and I tend to get better answers from this community than any where else.
    Somehow, my school and industry experience have somehow not given me the opportunity to explore and understand heaps (the data structure), so I'm investigating them now, and in particular, I've been looking at applications. I know they can be used for priority queues, heap sorts, and shortest path searches. However, I would have thought that, obviously, there must be some sort of relationship between the heap data structure, and the dynamic memory heap. Otherwise, I can think of no good reason why the dynamic memory heap would be named "heap". Surprisingly, after searching the web for 90 minutes or so, I've seen vague references, but nothing conclusive (trouble seems to be that it's hard to get Google to understand that I'm using the word "heap" in two different contexts, and similarly, it would not likely understand that web authors would use the word in two different contexts).
    The Java Virtual Machine Spec is silent on the subject, as "The Java virtual machine assumes no particular type of automatic storage management system, and the storage management technique may be chosen according to the implementor's system requirements."
    I've seen things like:
    [of dynamic memory] "All the blocks of a particular size are kept in a sorted linked list or tree (I extrapolate that sorted tree could imply heap)"
    [of dynamic memory] "The free and reserved areas of memory are maintained in a data structure similar to binary trees called a heap"
    [of dynamic memory] "This is not related to the heap data structure"
    [of dynamic memory] "Not to be confused with the data structure known as a "heap"
    [of data structure] "Not to be confused with the dynamic memory pool, often known as TheHeap"
    At this point, I've come to surmise that some (but not all) memory management algorithms use heaps to track which (pages? blocks? bytes?) of memory are used, and which are not. However, the point of a heap is to store data so that the max (or min) key is at the root of the heap. But we might want to allocate memory of different sizes at different times, so it wouldn't make sense to key on the amount of available memory in a particular region of the free store.
    I must assume then that there would be a different heap maintained for each size of memory block that can be allocated, and the key must have something to do with the attractiveness of the particular memory block in the heap (perhaps the lowest address, resulting, hopefully, in growing the free store space less often, leaving more space for the stack to grow, or perhaps keyed based on the fragmentation, to hopefully result in less fragmentation, and therefore more efficient use of the memory space, or perhaps based on page boundaries, keeping as much data in the same page as possible, etc).
    So at this point, I have a few questions I've been unable to resolve completely:
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?
    2. If so, would it be correct that there would be a heap per standard block size?
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?
    Any insight would be awesome!
    Thanks,
    A.

    jschell wrote:
    I think you are not only mixing terms but domains.
    For starters the OS allocs memory. Applications, regardless of language, request memory from the OS and use it in various ways.
    There are many variations of the term "heap" like the following.
    [http://en.wikipedia.org/wiki/Heap_(data_structure)]
    [http://en.wikipedia.org/wiki/Dynamic_memory_allocation]
    A java VM will request memory from the OS (from a 'heap') and use it in its application 'heap' (C/C++) and then create the Java 'heap'. There can be variations of that along the way that can and likely will include variations of how each heap is used, potentially code that creates its own heap, and potentially other allocators which use something which is not a heap.This last part, I find a bit confusing. By "use something which is not a heap", do you mean the heap data structure, or the dynamic memory pool meaning of heap? If the former, then you would be implying that it would be common for a heap data structure to be used to manage the heap dynamic memory pool. If the latter, what would this "something which is not a heap" be? The best definition of "heap" I've found simply states that it is a pool of memory that can be dynamically allocated. If there is some other way of allocating dynamic memory, then it would suggest that the previous definition of "heap" is incomplete.
    >
    So to terms.
    1. Am I correct that the heap was so named because (perhaps at one point in time), a heap is/was commonly used to track the available memory in the free store?Which 'heap'? The VM one? It is probably named that because the implementors of the Sun VM were familar with how C++ and Smalltalk allocated memory.Okay, but that begs the question, was the heap in C++ and/or Smalltalk so named for the above queried reason?
    >
    2. If so, would it be correct that there would be a heap per standard block size?Not sure what you are referring to but probably a detail of the implementation. And since there are different levels the question doesn't mean much.
    However OS allocations are always by block if that helps. After that it requires making the question much, much more specific.
    3. Also, at what level of granularity would a heap typically be used (memory page, memory blocks, individual words (4-bytes))?Again not specific enough. A typical standard implementation of heap could not be at the word level. And it is unlikely, but not impossible, that variations would support word size allocations.
    The VM heap might use word boundaries (but not size), where the application heap certainly does (word boundary.)My understanding of it is that the application would request blocks from the OS, and then something like malloc would manage the memory within the allocated blocks. malloc (or whatever equivalent Java uses) would have to keep track of the memory it has allocated somehow, and I would think it would have to do this at the word level, since it's most commonly going to allocate memory at the word level to be references to other objects, etc.
    So I guess my question here would really be, if the dynamic memory heap is so named because there has been a memory management strategy that relied upon a heap data structure (which I've found no proof, but have found some suggestive literature), then would that probably have applied at the OS Page Fault level, tracking allocated blocks, or would that have applied at the malloc level, allocating individual words as necessary?
    >
    4. What would be the most likely property one would use as a key. That is, what makes the root item on the heap ideal?"Key" is not a term that will apply in this discussion.
    You appear to be referring to strategies for effective allocation of memory such as allocations from different regions by size comparison.
    It is possible that all levels might use such an allocator. General purpose applications do not sort allocations though (as per your one reference that mentions 'key'.) Sorry, I got the term "key" from an article I read regarding heaps, that indicates that a "key" is used to sort the elements, which I guess would be a more generalized way to make a heap than assuming a natural ordering on the elements in the heap. I'm not sure if the terminology is standard.
    >
    5. Would a industrial strength system like the jvm use a (perhaps modified or tuned) heap for this sort of task, or would this typically be too naive for an real world solution today?Again too indefinite. The Sun VM uses a rather complicated allocator, the model for which originated after years of proceeding research certainly in Smalltalk and in Lisp as well, both commercially and academically.
    I am sure the default is rules driven either explicitly or implicitly as well. So it is self tuning.
    There are command line options that allow you to change how it works as well.I guess perhaps I could attempt to clarify my initial question a bit.
    There is a 1:1 correspondence between the runtime stack, and a stack data structure. That is, when you call a function, it pushes a stack frame onto the runtime stack. When you return from a function, it pops a stack frame from the runtime stack. This is almost certainly the reasons the runtime stack is named as it is.
    The question is, is there or has there ever been a 1:1 correspondence between some aspect of the dynamic memory heap or how it is managed, and a heap data structure? If so, it would explain the name, but I'm a bit puzzled as to how a heap data structure would be of assistance in creating or managing the dynamic memory heap. If not, on the other hand, then does anybody know where the name "heap" came from, as it applies to the dynamic memory pool?
    A.

  • Trees Data Structures in Java

    Hi all !
    Currently I�m developing a Java software that requires a Tree data structure. Searching through Java API I�ve found classes like TreeMap and TreeSet, but although these classes seens to use tree structure behind what they really provide are linear data structure, not a tree data structure. My question is if there is a public and free Java tree data structure that permits to do activities such as:
    - Search for a particular node (efficiently)
    - Insert children to any node
    - Maintain one Object in each node
    Simple like this ! It must have something like this in Java, but I just can�t find it and I�m just too lazy to implement it :) ! Anyone can help me ?
    Thanks in advance !

    Mel,
    I�ve seen javax.swing.tree.TreeModel and its seens more like an implementation of Control in swing MVC (Model Vision Control) swing paradigm for JTree. It has listeners generated for manipulation events for example. It uses javax.swing.tree.DefaultMutableTreeNode for its nodes, and maybe I could use this class for the nodes of my tree since it has many useful operations. However still I miss a node searching operation that this class doesn�t have.
    Yes my problem is a simple Tree, but it is simple now and it might become much more complex, demanding more operations on the tree and specially efficient searching algorithms. Thats why I�m looking for a complete solution and I prefer something that is already done and well tested :) !
    Thanks for your tip !

  • Constracting an xml book data structure

    I have to construct a book data structure storing detalis about a book, which i parse from a file containing the book in XML format.
    I've done the parser, but i'm trying to figure out what would be the best Class I could use as a Data Structure to store the book.
    I have to store info about the title, the author, chapters, etc etc, as well as the book itself...
    Any suggestions would be very appreciated.
    Thanx.
    P.

    If I understand correctly,
    you have an xml file that describes a book.
    Would it be an option, if you just create an oject Book that has all your necessary fields in it and populate that object with your xml values?
    for ex,
    class Book
    String author;
    String title;
    String[] chapters;
    }

  • Data Structures in SQL Server

    Friends,
    I am giving a session on "Data structures and SQL Server" for one of the SQL Server communities in India.
    My idea is to explain high level concepts of data structures (Stacks, Queues, Linked lists, Trees, Graphs etc.)
    here are my questions.
    Like to know how data structure concepts are implemented SQL Server components (in a high level).
    Here are some hints in my mind:
    1. Queues - SQL Server - DMVs for Processor Queue length, Disk Queue length etc.
    2. Linked Lists - SQL Server - Previous and Next page pointers in Page headers (and DBCC IND)
    3. Trees - SQL Server - Btrees in Indexes (DBCC IND and DBCC PAGE of Index pages)
    3. Linear Search - SQL Server - Table Scan
    4. Binary Search - SQL Server - Index Seek
    What i need is:
    1. Sorting algorithm used in SQL Server?
    2. Stack concept used in SQL Server? I think No
    3. what else data structure concepts are implemented in SQL Server (that can be demonstrated)
    Note: level: 300 - Intermediate to Advanced.
    Thanks in advance
    Ramkumar
    [email protected]
    Ramkumar Gopal Living For SQL Server Blog: http://www.sqlservercentral.com/blogs/livingforsqlserver/ Facebook: https://www.facebook.com/#!/groups/livingforsqlserver/ Twitter: https://twitter.com/LivingForSQL

    Hello,
    Take a look at some structures created for In-Memory OLTP (hash indexes, etc.)
    http://download.microsoft.com/download/5/F/8/5F8D223F-E08B-41CC-8CE5-95B79908A872/SQL_Server_2014_In-Memory_OLTP_TDM_White_Paper.pdf
    BUF Structures.
    http://blogs.msdn.com/b/karthick_pk/archive/2013/03/16/sql-server-memory.aspx
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Data Structure Needed

    *** PLEASE DO NOT REPLY TO THIS POSTING UNLESS
    *** YOU KNOW EXACTLY WHAT I AM TALKING ABOUT
    *** AND HAVE SOLUTION AT THE READY.
    *** NO SWING TREE FYIs PLEASE...doesn't apply.
    *** NO UI JAVASCRIPTS .. I HAVE THOSE.
    I need a properly constructed multiway
    (m-way, general, n-ary, etc.) data structure
    implementation that uses non-ui
    dependent/associated classes. This is know as the
    first child/next sibling data structure used in
    Filesystems (similiar to a BTree).
    I am using many delimited strings, similiar to a
    directory/file structure path but the string is a
    software project hierarchy.
    [a string is structured like this]
    root|branch|...|branch|leaf
    [Process]
    1) the strings are fetched from DB by servlet.
    2) servlet feeds strings into data structure
    to eliminate duplicates and place in proper location.
    3) servlet uses contents of data structure to
    construct links that are coupled with the infamous
    ui-tree script.
    If you know your data structures and have an implementation
    that won't take me 6 days to modify for it to work I would
    appreciate your assistance. I am creating on my own as we
    speak but one from a more experienced java programmer would
    be better.
    Thank You,
    Kevin

    Sounds like one hell of a frustrated programmer over there - all those capitals an'all..
    If I understand you correctly, I don't think you'd take six days to implement this; just split your string by the separator;
    String[] split(String path, char sep, char esc) {
      String[] result = new String[0];
      int o = 0;
      int i; for (i=0; i<path.length(); ++i) {
        char c = path.charAt(i);
        if (c == esc) {
          ++i;
          continue;
        if (c == sep) {
          String substring = path.substring(o, i);
          String[] newresult = new String[result.length+1];
          System.arraycopy(result, 0, newresult, 0, result.length);
          newresult[result.length] = substring;
          result = newresult;
          o = i+1;
    }Then have a java.util.Hashtable as root, with all names in it pointers to either more Hashtables (nodes), or Strings (leaves). If it really does not get anymore complex than that (data associated with leaves, for example), you don't really have to use anything more complex than 'instanceof' here.
    Then start looping over all your String[] split paths, retrieve all nodes, if it's a String and you have a child for it, then convert it to a Hashtable, it it's a Hashtable trod along, if it isn't there create a String (unless you know you have an extra child, in which case you create a Hashtable).
    When you're ready to retrieve, just enumerate your root Hashtable, casting to String all the keys, examining all the values; if they are Hashtable, then recurse. If they're Strings, do your Thing (TM).

  • 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

Maybe you are looking for

  • How to stop voice when i tap

    i want to stop the voice when i tap on anything and went to SETTINGS, GENERAL, TURN ON MULTITASKING GESTURES, but not able to go any further.  please help.  Thanks

  • Need of value mapping  and fixed values in (conversions)under graphical map

    hi. helo all. i just want to know what  is the need of value mapping  and fixed values in (conversions)under graphical mappping. can any body explain me with real time example . waiting for your response. bye. regards. seeta ram.

  • [svn:osmf:] 14187: PARB changes: Make TimeUtil non-public, it doesn' t need to be part of the public API.

    Revision: 14187 Revision: 14187 Author:   [email protected] Date:     2010-02-16 09:37:39 -0800 (Tue, 16 Feb 2010) Log Message: PARB changes: Make TimeUtil non-public, it doesn't need to be part of the public API. Modified Paths:     osmf/trunk/frame

  • OID Provisioning issue

    I have a case where a user did not get updated in OID when his account got modified in OIM. This lead to a data mismatch between OID and OIM. Can I write a task to send his info into OID. Thanks M

  • Items could not be synched

    I get this message when I synch my iPhone5 with my MacBook; "* items could not be synched. See iTunes for more information". I cannot see anywhere on iTunes to get that information so cannot tell what is not being synched and why. Any ideas?