Tags » Programming - Notes

Programming Notes: The O.C.

My last review was a disaster.¬†Most of what I wrote only made sense to me and was a frustrating exercise in producing content for content’s sake. 212 more words

Entertainment/Pop Culture

How to publish your code snippet in WP post

I must say right away I’ve found one WP shortcoming so far – you just can’t type a code snippet to show it properly as a snippet in your post. 88 more words

Search Products on Color part 2

Going back to my previous post on Color Search, where I described how to add Shop by color feature to your store. Doesn’t really matter if it is Cafepress store you’d like to add this extra Search function or to your blog… 419 more words

Cafepress Store - Shop by Color Feature

There is a thing with my Cafepress store that it lives on its own because there is no traffic to it sometimes and all sales I got on Cafepress so far, went through the “Cafepress Marketplace”.¬† 97 more words

Merge 2 sorted array

#include<bits/stdc++.h>
using namespace std;
vector<int> Merged(int arr1[],int arr2[],int n,int m){
    int i = 0,j = 0;
    vector<int>list;
    while(i<n and j<m){
        if(arr1[i]<=arr2[j]){
            list.push_back(arr1[i]);
            i++;
        }else{
            list.push_back(arr2[j]);
            j++;
        }
    }
    if(i<n){
        for(int l = i;l<n;l++){
            list.push_back(arr1[l]);
        }
    }else if(j<m){
        for(int l = j;l<m;l++){
            list.push_back(arr2[l]);
        }
    }
    return list;
}
int main(){
    int arr1[] = {4,45,89,90,123};
    int arr2[] = {7,28,43,101,145,160};
    int n = sizeof(arr1)/sizeof(int);
    int m = sizeof(arr2)/sizeof(int);
    vector<int>list = Merged(arr1,arr2,n,m);
    cout<<"Merged and Sorted Array: ";
    for(int i = 0;i<list.size();i++){
        cout<<list[i]<<" ";
    }
}
Programming Interview

Check whether the two tree equal or not

Idea:
The idea behind this code is that
1. Check the node value of two examine tree
if they are not identical then these tree not same… 240 more words

Programming Interview

Search in a row wise and column wise sorted matrix

#include<bits/stdc++.h>
using namespace std;
bool Search(int arr[4][4],int value){
    int row = 0, col = 3;
    while(1){
        //cout<<arr<<" ";
        if(row>3 or col<0)
            return false;
        if(value == arr){
            cout<<"Exist at : ["<<row+1<<"]["<<col+1<<"]"<<endl;
            return true;
        }
        if(value > arr){
            row++;
        }else {
            col--;
        }
    }
}
int main(){
    int matrix[4][4] = { {10, 20, 30, 40},
                        {15, 25, 35, 45},
                        {27, 29, 37, 48},
                        {32, 33, 39, 50},
                    };

    if(!Search(matrix,3)){
        cout<<"Don't Exist";
    }
}
… 12 more words
Programming Interview