Need help on Union operator

Im using oracle8, I want to write a query something like this,
SELECT x,y,z from (subquery)
UNION
SELECT x,y,z from (subquery)
UNION
SELECT x,y,z from (subquery)
But the subquery is that long that I cannot repeat it in every select statement. So i want to define an alias for the subquery, and use it in every select statement. I want to do all this in just SQL, not PL/SQL, since I'll be using this query in cogos. Any sugesstions?

Not that it's any help to you, but Oracle 9i has provided the WITH clause, which allows us to alias sub-queries just like you want to do. It also executes the sub-query just the once, so there are some good performance gains, even for correlated sub-queries.
Cheers, APC

Similar Messages

  • Need help in String operations

    HI all,
    I need help in String operations.I am getting file path of an image as
    c:\test\img\abc.gif"
    I need to convert it in to c:/test/img/abc.gif".
    Can any one suggest the solution for this.
    Thanks,
    Durga.

    [email protected] wrote:
    I used String replace method but I am not able to do it because "/" is a special character."/" is not a special character, "\" is a special character, which needs to be escaped by "\" itself.

  • Need help with 'division' operation in RTF template

    We are using variables in RTF template to perform all data manipulations
    To calculate columns where we need to do division operation, using ‘/’ or ‘DIV’ is not working.
    Using <?xdofx: op1 DIV op2?> is working only when op1 and op2 are numbers like ex. <?xdofx: 100 DIV 50?> returns result 2.
    But the same tag used for columns or variables is not working.
    For ex.
    <?xdofx: (xdoxslt:get_variable($_XDOCTX, 'var1')) DIV xdoxslt:get_variable($_XDOCTX, 'var2') ?> is not returning any result, though
    <?xdoxslt:get_variable($_XDOCTX, ‘var1’)?>
    <?xdoxslt:get_variable($_XDOCTX, ‘var2’)?>
    both are returning values stand alone.

    On Thu, 03 Jan 2008 00:22:31 -0500, Alan
    <[email protected]> wrote:
    >yes, the use of child page comments in a template file is
    probably the
    >problem. But if that is solved, having two editable
    regions with the same
    >name will cause problems.
    >
    >short version- things be horked big time.
    <chuckle /> Methinks you're right. It looks like the
    copy/paste monster
    has been munching on it. One guess to fix it would be to open
    it in a
    text editor and change this:
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <!-- InstanceBeginEditable name="head" -->
    To this:
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    And change this:
    <!-- InstanceEndEditable --></head>
    To this:
    </head>
    Gary

  • Need help for Onyx operating system

    Hello there
    I need help
    I using 9700 series and I want to upgrade my OS, but the problem is my carrier is not listed on this page http://na.blackberry.com/eng/support/downloads/download_sites.jsp
    My carrier
    three Indonesia
    my device vendor id is 352
    can you point me out where is the OS for that vendor id from this list http://na.blackberry.com/eng/support/downloads/download_sites.jsp
    thanks in advance
    ~Work like you don't need the money~
    ~Love like you've never been hurt~
    ~Dance like nobody is looking~

    sjafri wrote:
    the problem is that my carrier said that, if I using non official OS from them, my warranty will be void, that's why I asked where my vendor link, and I hope I can get answer at this forum.
    Hello,
    The above highlighted statement is false -- your warranty is not void if you use another carriers OS. However, if your carrier so chooses, then can indeed refuse you any support (including warranty support since it is they who service the warranty) until you are on their approved OS level. All of which means that they must actually supply you with an approved (by them) OS to use...it is their responsibility to do so.
    So, your choices are, as far as I can see:
    1) Wait until you receive an answer from your carrier as to the approved OS you can use along with how to obtain it.
    2) Use another carriers OS and, if anything goes wrong, fall back to your carriers approved OS before seeking more support from them.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Need help with union of two selects

    select 1 selects items for a timespan.
    But if there is nothing found at one date,
    the date is not returned so I want a union with a calendar table
    Both selects work but how to make the union?
    Thanks for any help!
    select 1:
    SELECT COUNT(*) COUNT,
    fb_operation prodstep,
    kalenderwoche datum
    FROM stoerung,
    kalender
    WHERE str_kommenzeit > to_date('13.06.2006', 'dd.mm.yyyy')
    AND str_kommenzeit < to_date('11.07.2006', 'dd.mm.yyyy')
    AND to_char(str_kommenzeit,'dd.mm.yyyy') = to_char(fulldate,'dd.mm.yyyy')
    GROUP BY fb_operation,
    kalenderwoche
    ORDER BY fb_operation,
    kalenderwoche
    select 2:
    SELECT kalenderwoche datum
    from kalender
    WHERE fulldate > to_date('13.06.2006', 'dd.mm.yyyy')
    AND fulldate < to_date('11.07.2006', 'dd.mm.yyyy')

    THANKS A LOT!
    I tested it and it gave me good results
    the problem I still have is that then I expand the Date to
    to_date('11.12.2006') I just get the weeks
    that contain data. But I need all weeks that are selected, if there is
    no data the other fields shall be null or 0.
    This is much too difficult for me perhaps you can also help me with this!
    select * from
    (SELECT COUNT(*) COUNT,
    fb_operation prodstep,
    kalenderwoche datum
    FROM stoerung,
    kalender
    WHERE str_kommenzeit > to_date('13.06.2006', 'dd.mm.yyyy')
    AND str_kommenzeit < to_date('11.12.2006', 'dd.mm.yyyy')
    AND to_char(str_kommenzeit,'dd.mm.yyyy') = to_char(fulldate,'dd.mm.yyyy')
    GROUP BY fb_operation,
    kalenderwoche
    ORDER BY fb_operation,
    kalenderwoche) A,
    (SELECT kalenderwoche datum
    from kalender
    WHERE fulldate > to_date('13.06.2006', 'dd.mm.yyyy')
    AND fulldate < to_date('11.12.2006', 'dd.mm.yyyy') ) B
    where A.datum = B.datum (+)

  • I need help with my operating system

    Okay, little bit of background:
    I bought the iMac second hand from a family friend who we no longer have contact with, the operating system etc was already installed.
    The disk drive on the mac is broke (I dont have the disks anyway, so it would be no use)
    I never purchased the operating system, like I said, it was pre-loaded.
    A few programmes weren't running correctly and the computer was just generally running slowly, so I decided to just restore the system as there was no important data on it and it would run faster in the end, and I figured the programmes would run properly again once restored.
    Anyway, I unknowingly deleted the operating system in the process of the restore (I thought it would only delete personal data like it does on my windows PC)
    I have no restore disk (a broken disk drive anyway), my apple ID was not used to buy the operating system, so therefore it cant be used to restore the operating system, I also never backed up the harddrive externally so it cant be reinstalled from that.
    My problem: I have no operating system and no way of recovering it. I read about Mavericks and because its free, I decided to try and download it, but with no operating system, the mac can only run 'Safari' and wont save things I try to download to the harddrive (it just says theres no space and the download doesnt happen). I also tried to access the App Store from Safari to try to download OS X lion on my apple ID, but once again, when using Safari on a mac without an operating system, it is very restrictive and I cant access the download page.
    I have no idea what to do and live miles away from the nearest apple store.
    Thanks in advance for any help provided by anyone.
    Jordan.
    Additional information:
    Its a 2007 iMac which was running OS X Lion 10.7.4 (I think, it was definitely Lion though).
    Serial No. is W8*******X85
    <Edited by Host>

    Ah. Well, then you have an itty-bitty problem. You need to backup your files to start with. You will need your retail Snow Leopard installer DVD which your friend should have provided to you. If he did not then ask him to bring it to you. It belongs to you along with the original distribution discs that came with computer when it was new.
    Do the following once you have the Snow Leopard DVD:
    Clean Install of Snow Leopard
    Be sure to make a backup first because the following procedure will erase
    the drive and everything on it.
         1. Boot the computer using the Snow Leopard Installer Disc or the Disc 1 that came
             with your computer.  Insert the disc into the optical drive and restart the computer.
             After the chime press and hold down the  "C" key.  Release the key when you see
             a small spinning gear appear below the dark gray Apple logo.
         2. After the installer loads select your language and click on the Continue
             button. When the menu bar appears select Disk Utility from the Utilities menu.
             After DU loads select the hard drive entry from the left side list (mfgr.'s ID and drive
             size.)  Click on the Partition tab in the DU main window.  Set the number of
             partitions to one (1) from the Partitions drop down menu, click on Options button
             and select GUID, click on OK, then set the format type to MacOS Extended
             (Journaled, if supported), then click on the Apply button.
         3. When the formatting has completed quit DU and return to the installer.  Proceed
             with the OS X installation and follow the directions included with the installer.
         4. When the installation has completed your computer will Restart into the Setup
             Assistant. Be sure you configure your initial admin account with the exact same
             username and password that you used on your old drive. After you finish Setup
             Assistant will complete the installation after which you will be running a fresh
             install of OS X.  You can now begin the update process by opening Software
             Update and installing all recommended updates to bring your installation current.
    Download and install Mac OS X 10.6.8 Update Combo v1.1.
    Upgrading to Lion
    You can purchase Lion at the Online Apple Store. The cost is $19.99 (as it was before) plus tax.  It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
         Lion System Requirements
           1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
               or Xeon processor
           2. 2GB of memory
           3. OS X v10.6.6 or later (v10.6.8 recommended)
           4. 7GB of available space
           5. Some features require an Apple ID; terms apply.
    After you sign into your App Store account with your Apple ID click on the Redeem option under Quick Links to download your copy of Lion.
    As an aside to this: All actual 2007 iMacs are able to run Mavericks. So rather than buying Lion you may prefer to upgrade to Mavericks which is Free.

  • Need help about Financials Operating Unit Level Setup data object transforming

    Hi All,
    We met some issues while using iSetup to create new OU from existing one via 'Financials Operating Unit Level Setup’ template and need your help.
    We can perform Extracting successfully, but when we’re tring to proceed Transform, it seems iSetup can’t meet our expectation.
    Firstly, after succesful creation of the Transform for 'Financials Operating Unit Level Setup’.
    We clicked the transform icon and it led us to the Details page.
    However, we can’t search out any result on that page, is it a bug?
    If we didn’t performed ‘Transform All’, then there’s no row shows on Transform Details page so we can't make any transform, as below:
    But after performing a ‘Transform All’ task, revisite the Details page and unfreeze, Operating Units and Inventory Organizations became transformable, as shown in below screenshots.
    Secondly, we found the transformable data objects are so limited, even the whole Payable Options and Finacial Options doesn’t support, as well as the Operating Unit short code.
    Is there any documents indicating which data objects are transform supported? Or if there’s any sql query for it?
    Will be very appreciated if anyone can help.
    Regards,
    Genghua Guo

    Hi,
    According to your description, my understanding is that machines failed to ping the server name, and successfully to ping its IP address.
    First check to see if DNS related port 53 is opened on the DC, or disable any anti-various software temporally, then ping the DC’s
    FQDN and confirm that if the name would be resolved.
    >The host 7acf7675-12f6-4280-84ff-ca225bc99373._msdcs.REGENCYVILLAGE.LOCAL could not be resolved to an IP address.
    You domain name is REGENCYVILLAGE.LOCAL. It seems that the DNS server failed to resolve your DC’s name. check the zone named REGENCYVILLAGE.LOCAL to see if an A record is corresponding to your DC.
    >75.75.75.75 (<name unavailable>) [Invalid], 75.75.76.76 (<name unavailable>) [Invalid]
    It seems that invalid IP address of DNS server on the TCP/IP properties of DC. 
    I want to confirm with you that if you have installed the DNS with installing AD DS. Just the DC’s name can’t be resolved? Or any other device also has the same question?
    =======
    You may use AD DS Best Practices Analyzer (BPA), which is a server management tool that can help you implement best practices in the configuration of your Active Directory environment. Detailed information reference:
    https://technet.microsoft.com/en-us/library/dd391875(v=ws.10).aspx
    besides, suggestion about Active Directory Best practices, just for you reference:
    https://technet.microsoft.com/en-us/library/cc778219%28v=ws.10%29.aspx?f=255&MSPPError=-2147217396
    Best Regards,
    Eve Wang
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Need Help in Union of Columns in FX

    Hello Experts,
    In database I have a table having two columns, Version From, Version To.
    Column "Version Start" data is like
    V0, V1, V2, V3, V4....upto V11 (fixed value)
    Column "Version End" data is like
    V1, V2, V3..... upto V11 (fixed value V0 is not present)
    User requirement is like create two prompts on these columns and select the data
    between these two fields and see the report. This is achieved by prompt and presentation variable.
    But the problem is let say user select V1 from Version Start, then Version End prompt should show all values apart from V1.
    If user select V2 then it should all value in Version End apart from V2.
    I tried but it seems 'union' function does not work in rpd bmm, nor in fx in OBIEE 10g.
    Can you all please help.
    Thanks

    The easiest way to do this, and it could be done in a few minutes, would be to move to a currently supported version of Oracle, 11gR1 or 11gR2, where we have the PIVOT and UNPIVOT operators.
    In the desupported version you have the best choice is to hit http://asktom.oracle.com and look up the solution he published there some years ago.
    I don't have the link so you can find it as fast as I can but look under "pivot" and "crosstab."

  • Need help on upgrading operating system from Mac OSX 10.3.9

    We have a Imac G5 with Mac OS X v 10.3.9. We want an upgrade to run new ILife stuff. We don't know what we are doing.
    What should we get to update the operating system, where, and how do we upgrade the system?
    Are there any particular requirements that my computer will need? How do I know that I have them?
    Is there anything in particular in the System Profile that I need to make sure that I have?
    Thanks.

    You don't say what iMac G5 you have, but here's the *Mac OS X 10.5 Leopard installation system requirements* http://support.apple.com/kb/TA24950 You may have to increase your RAM. A minimum of 1GB is recommended. If you click on About This Mac, you will see how much RAM is currently installed.
    Leopard is no longer available at the Apple Store *but may be available by calling Apple Phone Sales @ 1-800-MY-APPLE (1-800-692-7753)*.
    Suggest you download the two PDF documents at the top of this link.
     Cheers, Tom
    Message was edited by: Texas Mac Man

  • Need help in LIKE operator

    Hi,
    Instead of using 2 different where clause in the below query, is it anyways there to fetch it in single clause. Bcoz depends upon the requirement I may have to use around 30 like operators. Please help me out.
    Query:
    select group from test
    where group like '%US%'
    and group like '%UK%'
    Data in test table:
    group
    AU_General
    US_General
    UK_car
    UK_bold
    US_hold
    Thanks

    user497267 wrote:
    Bcoz depends upon the requirement I may have to use around 30 like operators. ...so what?
    anyway, this might work
    regexp_like (group, '(US|UK)')as in
    SQL> with test as
      2  (
      3  select 'AU_General' grp from dual union all
      4  select 'US_General' grp from dual union all
      5  select 'UK_car    ' grp from dual union all
      6  select 'UK_bold   ' grp from dual union all
      7  select 'US_hold   ' grp from dual
      8  )
      9  select *
    10    from test
    11   where regexp_like (grp, '(US|UK)')
    12  /
    GRP
    US_General
    UK_car
    UK_bold
    US_hold

  • Need help with pivot operator

    Hi All,
    There is a table that has data loaded from a flat file and is in the following format
    RECTYPE     610     570     620     630     640     650     660     LOC_CODE
    x     Crawfordsville     CSC     Fort Wayne     Greenfield     LaPorte     Seymour     Vincennes     
    2010 Monthly Average     2.6     1.3     2.3     1.7     1     1     1     
    1/31/2011     1     1.4     1     2.5     4.6     1.7     3.3     
    2/28/2011     1     1     1     5     4     1     4     
    3/31/2011     1     1     2.3     3.3     5.3     3.3     3.1     
    4/30/2011     1.8     1.1     1.9     1     5.1     2.5     1.7     
    5/31/2011     1     6.7     2.3     1.1     5.6     2.1     1.4     
    6/30/2011     1.8     1.9     2.2     3     2.6     3     2.1     
    loc-code     610     8888     620     630     640     650     660     
    All are the DATA_TYPE'S=VARCHAR(20)
    I Want to change it into the following format
    date     1/31/2011     2/28/2011     3/31/2011     4/30/2011     5/31/2011     6/30/2011     loc_code     2010 monthly average
    Crawfordsville 1     1     1.8     1     1.8     610     2.6
    csc     1.4     1     1     1.1     6.7     1.9     570     1.3
    Fort Wayn      2.3     1.9     2.3     2.2     620     2.3
    Greenfield     2.5     5     3.3     1     1.1     3     630     1.7
    LaPorte     4.6     4     5.3     5.1     5.6     2.6     640     1
    Seymour     1.7     1     3.3     2.5     2.1     3     650     1
    Vincennes     3.3     4     3.1     1.7     1.4     2.1     660     1
    please need hellp.
    Thanks

    Hi,
    Sorry, I don't think there's any way to get exactly what you requested. The values you give in the PIVOT ... IN clause are exact values, not alternatives.
    You could do something like this to map all alternatives to a common value:
    WITH     got_dept_grp     AS
         SELECT     country_code, job, sal
         ,     CASE
                  WHEN  job IN ('SALESMAN', 'MANAGER') AND dept = 301 THEN 30
                  WHEN  job IN ('CLERK')               AND dept = 302 THEN 30
                                                                     ELSE dept
              END     AS dept_grp
         FROM     pivot_data
    SELECT     *
    FROM     got_dept_grp
    PIVOT     (     AVG (sal)
         FOR     (job, dept_grp)
         IN     ( ('SALESMAN', 30)
              , ('MANAGER' , 30)
              , ('CLERK'   , 30)
    ;In your sample data (and perhaps in your real data), it's about as easy to explicitly define the pivoted groups individually, like this:
    WITH     got_pivot_key     AS
         SELECT     country_code, sal
         ,     CASE
                  WHEN  job = 'SALESMAN' AND dept IN (30, 301) THEN 'd30_sls'
                  WHEN  job = 'MANAGER'  AND dept IN (30, 301) THEN 'd30_mgr'
                  WHEN  job = 'CLERK'    AND dept IN (30, 302) THEN 'd30_clrk'
              END     AS pivot_key
         FROM    pivot_data
    SELECT     *
    FROM     got_pivot_key
    PIVOT     (     AVG (sal)
         FOR     pivot_key
         IN     ( 'd30_sls'
              , 'd30_mgr'
              , 'd30_clrk'
    ;Thanks for posting the CREATE TABLE and INSERT statements; that really helps!

  • Need help in Delete operation using blazeDS

    Please find the flex client code and servlet code given below
    Trying to call a DELETE methods on the servlet using BlazeDS.Configuration is perfect in the proxy-config.xml and services-config.xml
    when DELETE is called with paramter user="krishna it is being printed as
    received DELETE operation with parameternull   
    My Question is why the servlet printing null value for the user where it should print "someuser"?Can some one help me on this?
    FLEX CLIENT
    <?xml version="1.0" encoding="utf-8"?><mx:Application  xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script><![CDATA[
     import mx.controls.Alert; 
    import mx.rpc.http.HTTPService; 
    import mx.rpc.events.ResultEvent; 
    import mx.rpc.events.FaultEvent; 
    public function callServletDELETE():void { 
    var service:HTTPService = new HTTPService();  
    //service.url= "http://localhost:8080/examples/blazeDS";service.destination=
    "BlazeDSHTTP"; //this is configured in proxy-config.xml fileservice.useProxy =
    true; service.method =
    "DELETE"; service.resultFormat=
    "e4x"; service.addEventListener(
    "result", billingCarrierResult);service.addEventListener(
    "fault", httpFault); service.send({user:
    'someuser'});}
    protected function billingCarrierResult(event:ResultEvent):void{
    serviceResultsTextArea.text =
    "Success with BlazeDS!\n"+event.result; 
    protected function httpFault(event:FaultEvent):void{
    serviceResultsTextArea.text =
    "Failure trying to access service.\n"+ event.fault.faultString + "\n" + event.fault.faultDetail;}
    ]]>
    </mx:Script> <mx:TextArea  id="serviceResultsTextArea" width="50%" height="50%" />
    <mx:Button  label="DELETE" click="callServletDELETE()"/>
    </mx:Application>
    servlet
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    * Simple example intended to demonstrate BlazeDS with HttpService.
    public class BlazeHttpExample extends HttpServlet
       //excluded other methods GET,POST as they are working fine
        * Handles the HTTP <code>DELETE</code> method.
        * @param request servlet request
        * @param response servlet response
       @Override
       protected void doDelete(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
          System.out.println("received DELETE operation with parameter"+request.getParameter("user"));
       @Override
       public String getServletInfo()
          return "Simple intended to illustrate BlazeDS HttpService support.";

    in your java code you are considering user as the parameter.. but that is not a parameter..
    When making a http call in flex try something like this
    var obj:Object = new Object();
    obj["user"] = 'someuser';
    service.send(obj);
    this should work hopefully.

  • Need help with bitshift operation

    please help me divide a number with 24 using bitshift operation
    i know to multiply a number with 24
    x = (x<<4) + (x<<3)
    but how to divide it with 24???
    thanks a lot

    thanxx Abuse, i'll try to understand the code right now :)
    it's not for school exercise
    only want to use bitshift for my 24x24 tile background
    this one i use to get the shift operator
         public static int[] getShiftOperation(int num) {
              if (num % 2 != 0) throw new RuntimeException("num must be the power of two, 2,4,6,8,...");
              int[] base = new int[1];
              int i = 1;
              while (Math.pow(2,i) < num) i++;
              if (Math.pow(2,i) > num) {
                   int mod = num;
                   base[0] = --i;
                   do {
                        mod = mod-(int)Math.pow(2,base[base.length-1]);
                        i = shiftOp(mod);
                        if (i != 0) {
                             base = (int[]) Utility.expand(base,1);
                             base[base.length-1] = i;
                   } while (i != 0);
              } else base[0] = i;
              return base;
         private static int shiftOp(int num) {
              if (num == 0) return 0;
              int i = 1;
              while (Math.pow(2,i) < num) i++;
              if (Math.pow(2,i) > num) i--;
              return i;
         }and to multiply it with num
         public static int shiftMultiply(int num, int[] shift) {
              int result = 0;
              for (int i=0;i < shift.length;i++)
                   result += num<<shift;
              return result;
    thanxx

  • Need help upgrading my operating system

    I need to upgrade my existing operating system which is 10.4.11 to 10.5 so I can down load Pages. How do I go about doing that?

    The version of Pages available for download is in the Mac App Store. You need OS X 10.6.8 for the Mac App Store and additionally you need OS X 10.7.5 to run Pages. What you wish to do may not be possible with your old Mac.

  • Need help with union-by-size method

    Hello :)
    I'm having a problem with a union-by-size method.
    It was originally intended for a university assignment, but as I'm getting random errors by using it, I've changed to using union-by-heigth instead (which works flawlessly :-).
    But I'm still very much interested in finding out what I did wrong with the union-by-size implementation (as I belive it'd be the better method since I use path compression and a lot of find(x)).
    So if anyone can tell me what I'm doing wrong with the following code, I'd really appreciate it. As it is it is I'm getting ArrayIndexOutOfBoundsException with a positive much higher number than the array contains (ie. 1606 with a 900 long array)...
    (I've also gotten a few stackoverflows in main, but I guess that is more with too much printouts... )
    int[] union-by-size-array = new int[n*n] //implemented in other part of the code
    private void union (int root1, int root2){
            int temporaryInteger;
            if(union-by-size-array[root2] < union-by-size-array[root1]){
                temporaryInteger = union-by-size-array[root2];
                union-by-size-array[root1] = root2;
                union-by-size-array[navn2] += temporaryInteger;
            }else {
                temporaryInteger = union-by-size-array[root1];
                union-by-size-array[root2] = root1;
                union-by-size-array[root1] += temporaryInteger;
        }

    Ok, I'll supplement.
    n is given by the user as an argument.
    int nrOfDisJointSets = 1;
    int[][] board = new int[n][n];
    int[] ] union-by-size-array = new int[n+1];
        private void createNewNodeBoard(){
            for(int i = 0; i < n; i++){
                for(int j = 0; j <n; j++){
                    board[i][j] = createNode();
        private Node createNode(){
            Node newNode = new Node(nrOfDisJointSetst);
            union-by-size-array[nrOfDisJointSets] = -1;
            nrOfDisJointSets++;
            return newNode;
        }the union method is called by the following line
    union(find(x), find(y));navn2 is supposed to be root2 btw..

Maybe you are looking for

  • Installed Mavericks on headless (display-less) mini - now have SIX DISPLAYS trying to display!

    How do I get mac mini to stop trying to display SIX non-existent displays after installing Mavericks. This is a headless mini (server for media etc.) I can't even get into the system prefs because they just wildly flash all over the place.

  • Adding Web Streaming Video to a Slide

    'Don't know if I'm asking this correctly... Does anyone know or is there a way to add a live webpage that has streaming video? -So then when I play my slideshow the webpage shows the streaming video, gets updated each time I hit that particular slide

  • Every time i import a cd,it goes into a "compilations" folder.How do i fix?

    Every song or cd i import had the box checked that says "Part of a compilation". How and where do i go to uncheck this so it doesn't keep happening? I messed up somewhere. Please save me a trip to the apple store,as they are way to busy!!! Thank's in

  • AAA and TACACS servers

    Hello All, I want to download a free, yet reliable AAA and TACACS servers, can you guide me? Also, I need help with configuring them for study purpose.

  • Apps cannot be found

    I moved my iTunes library to a network drive. This works fine for music, but causes problems with syncing apps to the phone. If I buy a new app on the phone, it will sync over correctly. If I buy the app via iTunes on the Mac, when I attempt to sync