mojo666's Profile User Rating: -----

Reputation: 383 Architect
Active Posts:
832 (0.35 per day)
27-June 09
Profile Views:
Last Active:
User is offline Nov 16 2015 03:45 PM

Previous Fields

OS Preference:
Favorite Browser:
Favorite Processor:
Who Cares
Favorite Gaming Platform:
Your Car:
Who Cares
Dream Kudos:
Expert In:
Computer Science

Latest Visitors

Icon   mojo666 has not set their status

Posts I've Made

  1. In Topic: sorting program

    Posted 16 Nov 2015


    This is what I have so far, the program sorts the names but now i have to add the ages and I do not really know what to do next.

    So you have two unsorted arrays (one for names, the other for ages). You make two pointer arrays and populate them with pointers to the corresponding record in the unsorted arrays. All you have to do for ages is make the same swaps that you do for names. So, if you swap ptrNames[5] with ptrNames[2] then you should also swap ptrAge[5] with ptrAge[2]. You should adjust your sort function to take the age pointer array as a parameter in addition to the name pointer array. Also, where you code to swap name pointers, add code to swap age pointers at the same position in the array.
  2. In Topic: Queue Help Needed

    Posted 9 Nov 2015


    I don't see how the LinkedList's insert is inserting into the front. It goes to the Node behind the header

    You are correct. I misread the function. However, it is inserting to the node behind the node behind the node of the header.

    Insert 1
    newnode->prev = header->prev->prev // newnode->prev=header
    newnode->next = header->prev //newnode->next=header
    Insert 2
    newnode->prev = header->prev->prev // header->prev->prev is header
    newnode->next = header->prev //newnode->next=1
    The list is currently h <-> 2 <-> 1 <-> h
    Insert 3
    newnode->prev = header->prev->prev // newnode->prev=2
    newnode->next = header->prev //newnode->next=1
    The list is currently h <-> 2 <-> 3 <-> 1 <-> h

    Either way, it is not inserting at the end of the list.

    I am also leary about your erase function. If implemented correctly, header->next->prev is the same as header. But more importantly, you should never delete header. If you are trying to remove the first node, you should make a new pointer "temp", set it to header->next, adjust your list pointers and then delete "temp".

    I would test the list a bit and make sure it is performing as expected.
  3. In Topic: Queue Help Needed

    Posted 9 Nov 2015

    Push_Back needs to add the record to the end of the queue.

    template <class T>  
     void Queue<T>::push_back(const T value){  

    The linklist insert method adds the record to the front of the queue. The result is that each radix is output in reverse order. I believe your code is outputting 15, 11, 28, 22, 34, 30, 43, 57, 66, 79.
  4. In Topic: It is possible? (Square shape with numbers)

    Posted 26 Oct 2015

    I think you are overcomplicating things. You should only need 3 variables: height, row, column. From these 3 variables, you should be able to find the value that goes into each location.
    int height=4;
    int row;
    int column;
    		if(/*inequality indicating top left portion*/) //top left pattern
    			/*fill in logic*/
    		else //bottom right pattern
    			/*fill in logic*/

    To figure out patterns, you should try to compare coordinates of like numbers.

    For example, the top left half of the square

    (0,0) = 1 * height
    (0,1) and (1,0) = 2 * height
    (0,2), (2,0), and (1,1) = 3 * height
    (0,3), (3,0), (1,2), and (2,1) = 4 * height

    As for the bottom right part of the square you are trying to figure out:

    The 1st number on the right is always 1*height
    The 2nd number on the right is always 2*height
    The 3rd number on the right is always 3*height
    and so on.
  5. In Topic: Looking to study IC design

    Posted 8 Oct 2015

    To give you a little simplified insight...


    How can electrical charges be used to represent quantities?

    The electricity powers some kind of output device. The simplest conceptual output is a line of light bulbs. Each light represents a digit of binary code. If a light is off, that digit is 0. If it is on, that digit is 1.


    And how are these quantities physically hard-wired to perform arithmetic and logic operations?

    A basic circuit is a loop with a battery, a switch, and a light. You can make slightly more complicated ciruits by adding multiple switches and loops. A single loop with 2 switches in a row will only light the bulb if both switches are on. This is called an "AND" gate because it coresponds to the logical "AND" operation. If you have 2 parallel paths to the bulb each with a switch, the bulb will light if either switch is on. This is called an "OR" gate because it coresponds to the logical "OR" operation. Now, rather than physical switches, lets introduce electrical switches. These switches receive an external electrical signal affecting whether it is on or off. Rather than having our circuit output to a light, it can output to an electrical switch on a different circuit affecting the output of that circuit. Setting up a bunch of these logical circuits to act as input for electric switches of other circuits can simulate complicated operations.


    What are all of the different computational functions are used to design a fully functional microprocessor

    "Gates" are the basic unit. "AND", "OR" and "NOT" are the minimum operations that need to be simulated. These are combined to produce other gates or more complex structures such as adders, multiplexers, demultiplexers, ect.

My Information

Member Title:
D.I.C Addict
31 years old
July 23, 1984
Chess, math, computers, AI
Years Programming:
Programming Languages:

Contact Information

Website URL:
Website URL  http://



mojo666 has no profile comments yet. Why not say hello?