Stuff to Know:
1) sorting
2) objects
3) timing
4) new/delete
5) growable arrays

Timing
Linear:
void func (int N)
	{int total=0
		for (int i=0;i<N;i++)
			{for (int j=0, i<10;j++)
				{total t=N;}}}
Quadratic:
void func (int N)
	{int total=0
		for (int i=0;i<N;i++)
			{for (int j=0, i<N;j++)
				{total t=N;}}}
				
-know how fast something is based on the speed and the algorithm.
example: 1000 sorted in 10 usec using nlog2n.
	1)find total amount of ops done by putting number sorted in algorithm for n.
	2)divide by time to get operations per second rate of system.
	3)put ops per second rate into alternate algorithm

milli: 10^-3
micro: 10^-6
nano: 10^-9
pico: 10^-12

Objects:
struct car
{string color;
int mpg;price};

car makecar(c,mp)
{car c,
etc

-this is basic way to make objects.

CONSTUCTORS:
-use them to avoid external functions to fill structs
-they're functions in the struct designed to initialize shit

struct car
{string color;
int mpg, price;

Constructor car(string c, int m, int p)
{color=c; mpg=m;price=p;}};

void main()
{car a("blue", 30, 100);

METHODS:
-a function inside of the struct
  
struct car
{
…
…
void print()
{cout<<color
	<<….}

-you can have as many methods as you want.
-you only have one constructor
-constructor with a few methods is all you gotta know
-might combine objects with sorting

New/Delete:
-involves  pointers
car*pickcar(        _
{car*A;
A=new car("blue,30,10000);

-new takes memory and points to memory big enough for object.
pointer: car*B, values are crazy until initialized
-B=new car(); , creates an object at the pointer location.
-if you do A=B; for two pointers, the pointers will be pointing to the same object.
-however, there will still be values at the old pointer location, just no way to access them
-this is called a "memory leak"
-so if you want to swap values, you gotta do something else:

car*temp=A
A=B;

-so temp points to A, you don't lose A.
-then, delete temp;
-prevents memory leak
-you only need brackets w/arrays

car*inventory=new int[1000];
delete[]inventory;

car*mine=pickcar();

-pointers are good because they return a 4 byte int instead of a struct, making programs quicker.
-problem with pointers is when you follow them to something that is initialized, and you have to delete pointers whose values you change.
-accessing methods of pointers to structs:

mine->print();

LINKED LISTS

struct Link
{string s;
Link*next;
}

-you need pointers to point to objects of the same time.

GROWABLE ARRAYS
void main()
{
int size=10;
int*Arr;
Arr=new int[size];
for(int i=0;i<1000;i++)
	{Arr[i]=i;	
	if (i>=size)
		resize(Arr,size);
	Arr[i]=i;}

resize func:
	void resize(int*a, int &s)
	{int*temp=new int[s*2] -you HAVE to do times 2.
		for(int i=0; i<s; i++)
		{temp[i]=a[i];}
		delete[a];
		a=temp;
		s=s*2;  

SORTING
-you gotta know how to code them

void selection Sort(string data[], int size)
	{
	string smallest=data[0];
	int pos=0;
	for (int=0; i<size;i++)
		{smallest=data[i];
		pos=i;
			for(int j=1;j<size;j+=1)
				{if(data[j]<smallest)
				smallest=data[j];
			pos=j;}}
			swap(data,i,pos;}}

void swap(string d[], int a, int b)
	{string temp=d[a];
	d[a]=d[b];
	d[b]=temp;}	

void BubbleSort (stringdata[],int size)
	{for(int i=0;i<size-1;i+=1)
		{for(int j=1;j<size;j+=1)
			{if(data[j-1]>data[j])
				swap(data,j-1,j);}}}