Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

algorithm - bubble sort for linked list in c++ -


i tried implement buble sort university project , have problems. happy if can me it.

void trainmanagerlinkedlist:: swap(trainmanager & x,trainmanager & y)  {   trainmanager temp;   temp =x;   x = y;   y = temp;  }  void trainmanagerlinkedlist::bubblesort()  {   trainmanagerlink* outercurr = this->m_head;   trainmanagerlink* curr = null;    while(outercurr != null)   {    curr = this->m_head;    while(curr != null && curr->m_next != null)    {     /*if current link greater next swap between them*/     if (curr->m_data->getdate() > curr->m_next->m_data->getdate())     {      swap(&(curr->m_data),&(curr->m_next->m_data));     }     else if((curr->m_data->getdate() == curr->m_next->m_data->getdate())&(curr->m_data->gettime() > curr->m_next->m_data->gettime()))     {       swap(&(curr->m_data),&(curr->m_next->m_data));     }     curr = curr->m_next;    }    outercurr = outercurr->m_next;   }   /*now list sorted :)*/   } 

my data types

trainmanagerlink *m_head;  trainmanagerlink *m_tail;  int m_numofelements;  class trainmanager {  char * m_firststation;  char *m_laststation;  char * m_origin;  char * m_destination;  int m_timebetweenstations;  hour m_releasetime;  hour m_arrivetime;  hour m_firsthour;  date m_date;  int m_standinstation;  delayerslinkedlist delay; } 

the linked list should sorted date , hour. have compile problems. relly need thank you,:)

in general there issues address follows:

  1. your class trainmanager has char* members not std::string, , not managing memory. not mention members private, may give issues when try comparing members.

  2. you better swap "links" rather swap actual data inside them.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -