Search:

Type: Posts; User: monkey_c_monkey

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    2,871

    Let's reuse quick sort, so if best case is...

    Let's reuse quick sort, so if best case is O(nlogbase2n) then it means this the worst it can do, but wouldn't that be wrong since we can do worse, which is quadratic time. I'm assuming Wikipedia is...
  2. Replies
    6
    Views
    2,871

    asymptotic notation clarify

    to clarify: if we're talking about worst case, we should use big O, and average case can be big O, but best case I should use Big omega and not big O since it means we can do better which isn't true...
  3. Better to add data or new node as parameter

    I'm learning graphs and I am building a digraph via adjacent list, so I'm going to use an array of ptrs, so each index in array stores head ptr to a linked list of adjacente vertices where first node...
  4. Replies
    2
    Views
    1,331

    So you mean in main it be: for each index for...

    So you mean in main it be:
    for each index
    for each adjacent vertex to current vertex @ graph[i].begin

    also, begin refers to the head pointer, right, and NOT the first node (since it's an array...
  5. Replies
    2
    Views
    1,331

    graph dfs troubles

    I'm stuck on how the Depth first search outputs vertex 7, 9 for the given example using adjaceny lists:
    The square brackets b/c it's an array of linked lists (so all adjacent nodes withing a given...
  6. Replies
    5
    Views
    9,891

    I built a plinko board simulation for my computer...

    I built a plinko board simulation for my computer modelling class. You should look for a pattern in the pegs. Notice how the paths a ball can move through alternate b/t 8 and 9 choices to traverse...
  7. Replies
    1
    Views
    8,377

    How to print passes in quick sort

    I wrote in place quick sort, but I'm not sure how to print passes, here is a code I found online @ QUICKSORT (Java, C++) | Algorithms and Data Structures, I would like to learn how to print passes...
  8. Replies
    3
    Views
    1,318

    Topics for comp sci research course

    Hi, I'm in my 2nd year and a requirement to graduate at my college is to take a course on comp sci research. I've been told to use ACM for resources but I'm not sure specifically what to choose. I...
  9. I didn't know you could do that.

    I didn't know you could do that.
  10. Cleaner way to pass numeric data in generic linked list

    I'm writing a simple generic singly linked list implementation of a stack:


    typedef struct LL_stack
    {
    struct LL_stack* next;
    void* data;
    } node;

    My push fcn prototype:
  11. array of ptrs vs constant ptr to an first element of array

    I'm unsure why both the array of ptrs and the 'regular' arr both work, shouldn't the former array, it should be 'dereferenced' twice, once to pt the actual first address of first element and the...
  12. Replies
    2
    Views
    1,845

    Regarding allocating memory

    To check if a new node can be inserted, I use dynamic memory allocation so if heap is full, then no new node returned (false returned). But if I created new node non-dynamically, it would come from...
  13. Replies
    3
    Views
    1,512

    Clarify pass by reference

    For this simple singly linked list, I thought pass by reference stores address, not the copy of object so it's more efficient, then why do I have to 'dereference' head in main if I want to use...
  14. Replies
    4
    Views
    1,795

    I did not catch that, thanks! Also, so I've...

    I did not catch that, thanks!

    Also, so I've checked stack overflow forum and how we should AVOID returning address of local var b/c even if we can access the value, it may be overwritten w/o...
  15. Replies
    4
    Views
    1,795

    Doubly circular linked list

    I'm building trivial doubly circular linked list and I have partially written insert at front function, so far I have the case when the list is empty (head is NULL), but why does it output 10 if I do...
  16. using '.' over '->' operator in struct

    I'm building trivial doubly circular linked list and I'm curious why I cannot do something such as:
    cur = cur.next since 'cur' is a pointer and the member 'next' is also a pointer so that's why...
  17. Replies
    13
    Views
    1,621

    So basically C++ decided to use "this" as a...

    So basically C++ decided to use "this" as a pointer and the C++ standard decided to stick w/ it rather than use "this" as a reference? So that's why we need to mix pointers and reference (which is...
  18. Replies
    13
    Views
    1,621

    Clarifying the "this" pointer

    I understand we return by address or return by reference in order to reduce memory usage by only returning the memory location of the object.

    For the two snippets, the former is a Calculator...
  19. trouble setting up GLEW in Visual C++ 2010 Express

    I hope someone can help. I got FreeGLUT working w/ VC++, but I can't get GLEW to work. I put the GLEW headers into: C:\Program Files(x86)\Windows SDKs\V7.0A\Include\gl, I put the GLEW static...
  20. Replies
    8
    Views
    1,805

    I'm going to have to look into what whiteflags...

    I'm going to have to look into what whiteflags says about chcp/active code page output stuff and as for my OP, I looked @ ASCII table and ASCII 5 is ENQ (enquiry) so when I outputted plaint_txt[0]...
  21. Replies
    8
    Views
    1,805

    Actually, I'm asking if how I applied XOR using...

    Actually, I'm asking if how I applied XOR using my example in OP is correct. And for the other question, I just didn't know when yo output array name, it outputs each char whereas the string array,...
  22. Replies
    8
    Views
    1,805

    But in terms of logic, is what I'm doing correct,...

    But in terms of logic, is what I'm doing correct, so key[2] and key[3] are not used in the encryption since I have: 'A' XOR 'D' (which is plain_txt[0] XOR key[0]) and 'B' XOR 'E' (which is...
  23. Replies
    8
    Views
    1,805

    Xor encryptiong clarification

    For this simple XOR encryption, I want to XOR each byte so I used a char type for plain text and key. This is how I think the logic is applied, but the ciphertext comes out as the club character...
  24. Replies
    4
    Views
    1,174

    static lib vs dynamic lib

    Is it safe to say we'd use static libraries when a program relies on functionality that rarely changes, such as C++ and STL (standard template library?) despite more space used since static library...
  25. I'm not sure exactly how. This is what I have:...

    I'm not sure exactly how. This is what I have:
    So the functions I wrote are:
    1)print_bits_ : converts base-10 to binary
    2) is_on : to test if a single bit in target val is on or not
    3) turn_on :...
Results 1 to 25 of 88
Page 1 of 4 1 2 3 4