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

Reputation: 377 Architect
Group:
Expert
Active Posts:
817 (0.37 per day)
Joined:
27-June 09
Profile Views:
12,940
Last Active:
User is offline Jul 27 2015 12:35 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Mozilla
Favorite Processor:
Who Cares
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Expert In:
Computer Science

Latest Visitors

Icon   mojo666 has not set their status

Posts I've Made

  1. In Topic: Challenge: Keep track of the median of a stream of integers

    Posted 27 Jul 2015

    Quote

    O(1) time and O(1) space
    .
    .
    .
    I'm pretty sure there is an easy way to do this in constant space in exact time but I haven't worked though all the details yet.


    This is only possible if by "Integer" you mean "An integer within a given range or other finite set of values". If we are reading integers of any possible value, then every integer we have already read can become the median in the future, so every integer needs to be stored.

    For cases where we do have a range, we can implement a counting algorithm as outlined below.

    Spoiler
  2. In Topic: Find max ranking value for a group of students

    Posted 24 Jul 2015

    Quote

    GROUP BY c.clustername, cty.county, cc.id, d.IRN, d.district, cc.ranking

    HAVING cc.ranking = MAX(cc.ranking)


    cc.ranking is part of the group by, so the MAX is not really doing anything as aggregate functions only aggregate records in the group. You are telling the computer to find the maximum rank of a group of records that all have the same rank. If I understand your requirements correctly, I think you need to used a subquery.

    --Instead of this
    FROM tblCareerCluster cc  INNER JOIN 
    
    --use this
    FROM (SELECT id, MAX(ranking) FROM tblCareerCluster GROUP BY id) cc INNER JOIN
    
    


    This way, you are only joining to records that have the max ranking for each id.
  3. In Topic: C++ Linked List Help

    Posted 15 May 2015

    Best practice: you would implement a copy constructor. Once implemented, the line of code that executes it would look like found=new book(list);. If the object is simple enough, you can instead do the dirty method and copy all the properties.

    found = new book();
    found->title=list->title;
    //and do the same for other relevant properties
    
  4. In Topic: C++ Linked List Help

    Posted 15 May 2015

    found and list are both pointers, so when you set found = list; // Add the result to the results array to be displayed later, you are not adding anything to an array. You are setting both pointers to point to the same object. When you then set found->next to null, that is modifying the object that "list" is pointing to.
  5. In Topic: ADT Comples

    Posted 11 May 2015

    Quote

    I need to create an ADT Complex without using a class in c++


    Did you read the requirements correctly? Normally you are just restricted from using existing classes such as the complex class in the standard library.

My Information

Member Title:
D.I.C Addict
Age:
31 years old
Birthday:
July 23, 1984
Gender:
Interests:
Chess, math, computers, AI
Years Programming:
6
Programming Languages:
C++, C#, VB.net, SQL, OCAML, LISP, MIPS

Contact Information

E-mail:
Private
Website URL:
Website URL  http://

Friends

Comments

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