CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: pm_kirkham

Page 1 of 6 1 2 3 4

Search: Search took 0.03 seconds.

  1. Re: C++: Convert Jumple Word to Possible Words

    (see also http://forums.sun.com/thread.jspa?threadID=5378584&tstart=0 )
  2. Replies
    1
    Views
    872

    Re: finding MOD for each array element...

    Q[1] mod P = Z
    Q[2] mod P = Z
    Q[3] mod P = Zimplies
    Q[2] - Q[1] mod P = 0
    Q[3] - Q[2] mod P = 0
    Q[1] - Q[3] mod P = 0so P must be a factor of the difference of each of the values in Q, and one...
  3. Re: Why Interpreter Pattern can not be used for complex grammar

    In addition to virtual calls, the compiler hasn't the opportunity to inline constants, so there's a lot more memory traffic. Comparing the current character to the literal 'A' and doing a virtual...
  4. Replies
    1
    Views
    784

    Re: need help with that:

    http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=complexity1
  5. Re: Why Interpreter Pattern can not be used for complex grammar

    Implementations of expression grammar parsers often use the interpreter pattern. The difference between such systems and the example in the web page you cite is that the interpreter is interpreting...
  6. Re: what is the best Data Structure to hold 'grid' information?

    A 2D array of some structure holding the data for each 'cell' (are you booking a prison?) will probably do. Quite what that structure is, and whether anything different is required to hold the data...
  7. Replies
    7
    Views
    14,681

    Re: Abstract Syntax Tree Generator Tool

    There are many other parser tools - google for the names yacc, bison, antlr, rats, javacc, and I'm sure others. Too many to elaborate on without a specific question, and most of them I haven't used....
  8. Replies
    7
    Views
    14,681

    Re: Abstract Syntax Tree Generator Tool

    There is an option in gcc (-fdump-translation-unit) to dump AST information, but then you have to process that yourself. The Elsa C++ parser has a direct AST interface in C++, which might be...
  9. Replies
    7
    Views
    14,681

    Re: Abstract Syntax Tree Generator Tool

    Most compiler compilers or parser toolkits can be made to output a representation of an AST given the grammar of the language to be parsed. This has very little to do with profiling tools.

    Do you...
  10. Re: Search algorithm for a binary search tree.

    Maybe, but there's no way for me to know that the variable called 'tree root' is meant to be a sub-tree rather than the tree's root. You also aren't recursing into 'tree root', but into left and...
  11. Re: Search algorithm for a binary search tree.

    As written above, neither the value of p or el change during the algorithm, and you don't look at the value returned by the recursive calls to search, so it's the same as:


    Boolean search(Tree...
  12. Re: Hash Table - Multiple Keys for the same Data

    It's certainly a map of some time, and if it's implemented using hashing then it's a hash table. I'm not sure whether the advantage of your structure over either having a map/hash table of vertex to...
  13. Re: Sorted Structure/constant ith item access time

    Are those worst case or average?

    The primary operations of a VList are:
    * Locate the kth element (O(1) average, O(log n) worst-case)
    * Add an element to the front of the VList (O(1)...
  14. Re: URGENT: I need a pseudo code for performing a certain task

    Some hints, as this sounds like homework:

    The first column can contain the numbers 0 to K.

    Given the value in first column, how do the remaining columns look? Are they the same problem with...
  15. Replies
    2
    Views
    2,268

    Re: Finding most repeated sequence

    Why do you want this information?

    It won't be a tree, simply because people don't always browse linearly - it is, after all, a web of hypertext not a linear document. So expect branches and...
  16. Replies
    1
    Views
    1,387

    Re: Memorization with the minimax algorithm

    In order to use a std::map with arbitrary types, you supply a predicate which defines the ordering of the keys to use for the map. You could add an extra template parameter to capture the type of the...
  17. Replies
    2
    Views
    5,962

    Re: Circular Reference Pattern/Algorithm

    Sorting will tell you if an existing structure is invalid. If you are creating the structure, it's very easy to check by walking up the reports-to tree until you either get to the top (in which case...
  18. Re: Silhouette of some buildings in a city - Need help coding this algorithm, please!

    For small integers, just draw them on a bitmap and walk along the boundary.

    Other than that, a tree or skip list where inserting a rectangle can split a node in two so that given an initial...
  19. Re: How to partition integer with non-duplicated element sequences ?

    You don't want to generate combinations which are out of order, such as 6 = 2+3+1, so you pass the value you removed in the previous stage so you don't attempt to remove a value larger than it in the...
  20. Re: How to partition integer with non-duplicated element sequences ?

    You also should be passing the value you remove to your recursive method, so you don't remove a value greater than it.

    so you'd call part(n - t, t) for t up to n-1

    part(n,r) => t + part(n-t, t)...
  21. Replies
    2
    Views
    1,666

    Re: fundamentals time complexity

    This topcoder tutorial might be at the level you want.
  22. Replies
    1
    Views
    1,171

    Re: given N circles,how many pairs intersect

    R-tree or other efficient rectangular spatial index using the bounding box of the circle, followed by a test whether the circles really do intersect.
  23. Re: How to find whether a linked list is a circular linked list

    If you perform a linear scan for a fixed pointer on a 6 shaped circular list then the procedure will not terminate.

    Specifically, with the circular list:

    node_1 -> node_2 -> node_3 -> node_4...
  24. Re: How to find whether a linked list is a circular linked list

    The standard way of solving it for a singly linked list was posted by Zachm. This covers cases where the list is a 6 rather than an O - it is circular (ie if you iterate over it you won't reach the...
  25. Re: Does anybody know what R-tree applications are?

    wikipedia
Results 1 to 25 of 126
Page 1 of 6 1 2 3 4





Click Here to Expand Forum to Full Width

Featured