ivanseidel / ivanseidel/LinkedList
Linked_listC++
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 364
- Forks
- 117
- PR merge metrics
- No merged PRs in 30d
Description
class linked_list{
struct node{//عملنا العقدة حقنا
int data;
node* next;};
node* head=NULL;
public:
// دالة اضافة عنصر الى اخر القائمة
void apend_to_last(int val){
node* newnode=new node;
newnode->data=val;
newnode->next=NULL;
if(head==NULL)
head=newnode;
else{
node* temp=head;
while(temp->next!=NULL)
temp=temp->next;
temp->next=newnode;}}
//دالة البحث عن القيمة التي ادخلها المستخدم وحذفها
void delete_by_val(int val){
if(head==NULL)
{cout<<"no elements in linked list...\n";
return;}
nodetemp;
temp=head;
if(temp->data==val){
head=head->next;
delete temp;}
else{
nodeprev,temp;
prev=temp=head;
while(temp!=NULL&&temp->data!=val){
prev=temp;
temp=temp->next;}
if(temp==NULL)
{cout<<"not found \n";
return;}
else{
prev->next=temp->next;
delete temp;}}}
//دالة عرض عناصر القائمة المتصلة
void display(){
if(head==NULL){
cout<<"no element in linked list...\n";
return;}
nodetemp=head;
while(temp!=NULL){
cout<data<<"\t";
temp=temp->next;}}
//دالة اضافة قيمة معينة الى موقع معين
void insrt_by_pos(int pos,int val){
node* newnode=new node;
newnode->data=val;
newnode->next=NULL;
if(pos==0){
newnode->next=head;
head=newnode;}
else{
nodetemp=head;
for(int i=0;i<pos-1&&temp->next!=NULL;i++ )
temp=temp->next;
newnode->next=temp->next;
temp->next=newnode;}}
//دالة حذف قيمة في موقع معين
void delete_by_pos(int pos){
if(head==NULL){
cout<<"no element in linked list..\n";
return;}
if(pos==0){
nodetemp=head;
head=head->next;
delete temp;}
else {
nodetemp=head;
for(int i=0;i<pos-1&&temp->next!=NULL;i++)
temp=temp->next;
if(temp->next==NULL){
cout<<"ERORR enter corect position...\n";
return;}
nodetemp2=temp->next;
temp->next=temp->next->next;
delete temp2;}}
//دالة عرض القائمة بالعكس
void revers(){
if(head==NULL){
cout<<"no element in linked list...\n";
return;}
node* prev=NULL;
nodecurr=head;
nodenext=NULL;
while(curr!=NULL){
next=curr->next;
curr->next=prev;
prev=curr;
curr=next;}
head=prev;}};
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue contains a standalone C++ linked-list implementation but names no repository file, test, or requested change. First clarify whether this code is intended for the Arduino library and what behavior or integration is required; completion criteria are not specified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100