لوحة الإعلانات الخاصة بمواضيع وأخبار المنتدى
| مراقبة وتحديد الخاص |
| عند طرح المواضيع |
| عمل MMS |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
|
|
أدوات الموضوع | إبحث في الموضوع | انواع عرض الموضوع |
|
|
رقم المشاركة : 1 | |||
|
حل برنامج بواسطة ++C للمسائلة Double circular linked list
#include<iostream>
using namespace std; struct employee { int emp_id; float emp_salary; struct employee * llink; struct employee * rlink; }; void main() { struct employee n,*temp,*a,*t,*sort,*sortow; char ch='y'; int count='0' ,i='0'; int j,h,id,num; float salary; n.rlink=NULL; n.llink=NULL; temp=&n; sort=&n; t=&n; while(ch=='y') { a=(employee *)malloc(sizeof(employee)); cout<<"Enter the ID:::"; cin>>a->emp_id; cout<<"Enter the Salary:::"; cin>>a->emp_salary; a->llink=NULL; a->rlink=NULL; t->llink=a; a->rlink=t; t=t->llink; cout<<"Want to continue(y/n)::"; cin>>ch; } cout<<"The elements in the forward traversal is(L to R)::"<<endl; temp=temp->llink; t->llink=temp; temp->rlink=t; sort=temp; num=i; for (j=0;j<num;j++) { sortow=sort->llink; for(h=0;h<j;h++) { if (sort->emp_id <sortow->emp_id) { id=sort->emp_id ; salary=sort->emp_salary ; sort->emp_id =sortow->emp_id ; sort->emp_salary =sortow->emp_salary ; sortow->emp_id =id; sortow->emp_salary =salary; sortow=sortow->llink ; } } sort=sort->llink; } while(count!=i+10) { cout<<temp->emp_id <<"\t"; cout<<temp->emp_salary<<endl; temp=temp->llink; count++; } cout<<"The elements in the reverse traversal is(R to L)::"<<endl; count='0'; while(count!=i+10) { cout<<t->emp_id<<"\t"; cout<<t->emp_salary<<endl; t=t->rlink; count++; } } |
|||
|
|
|
رقم المشاركة : 2 | |||
|
يعطيك العافيه والله يجزاك بالخير ,,
لكن ياريت توضح أكثر عن ماهية هذه الرموز ,, و موفق بإذن الله ,, و ننتظر جديدكـ ,, |
|||
|
|
|
رقم المشاركة : 3 | |||
|
جزاك الله خير بس وضحلنا ايش يسوي البرنامج بالضبط
وشكرا |
|||
|
|
|
رقم المشاركة : 4 | |||
|
شكرا على الاهتمام بالموضوع والبرنامج بالفة ++c يقوم البرنامج بطباعة الارقام التي تم إدخالها من المبرمج على شكل قائمة متسلسلة ولكن هنا يقوم البرنامج بتشغيل قائمتين في نفس الوقت ويقوم بتكرار الارقام عشر مرات ويمكن تغير عدد التكرار على حسب الرغبة
|
|||
|
![]() |
| مواقع النشر (المفضلة) |
| الكلمات الدلالية (Tags) |
| linked list |
| أدوات الموضوع | إبحث في الموضوع |
| انواع عرض الموضوع | |
|
|
Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd
فخر هوست لخدمات الويب