Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 4_SL.C
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void main(){
new->data=x;
ptr->link=new;
break;
case 4: printf("\nEnter key: ");
case 4: printf("\nEnter key: "); //search
scanf("%d",&key);
ptr = header;
while(ptr->data!= key && ptr->link!=NULL){
Expand Down Expand Up @@ -145,4 +145,4 @@ void main(){

} // ENDWHILE
getch();
}
}
4 changes: 2 additions & 2 deletions LINEARSE.C
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main(){
printf("\nEnter element to be searched: ");
scanf("%d",&key);

for(i=0;i<n;i++){
for(i=0;i<n;i++){ //searching begins
if(a[i]==key){
printf("\nElement found at\n index: %d",i);
printf("\n position: %d", i+1);
Expand All @@ -33,4 +33,4 @@ void main(){

getch();

}
}